Mapping must be called using ServiceAdapter
See original GitHub issueI get the same error after calling the scan method in code. here is my Code
```
var Config = GetConfiguration();
Services.AddSingleton(Config);
Services.AddScoped<IMapper, ServiceMapper>();
Config.Scan(assemblies);
more informatino i use autofac for DI in .net core 3.1
Issue Analytics
- State:
- Created 3 years ago
- Comments:12
Top Results From Across the Web
Mapping must be called using ServiceAdapter · Issue #224
when I want to use MapContext.Current.GetService() in my mapping I get the error Mapping must be called using ServiceAdapter ? public class ......
Read more >Using Mapster w/DI where should I be putting my mapping?
Config in the Startup.ConfigureServices method Iget an error "Mapping must be called using ServiceAdapter". Not sure how/where that would be ...
Read more >Mapster
I'm using ProjectToType to generate mapping expressions for both SQL Server projects and a MongoDB project: ... Mapping must be called using ServiceAdapter....
Read more >InvalidOperationException when using DI in collection ...
System.InvalidOperationException : Mapping must be called using ServiceAdapter at Mapster.TypeAdapterExtensions.GetService[TService](MapContext ...
Read more >Creating a Service Adapter using On-Demand Services SDK
Your service adapter must provide the following: The mapping of instance groups to jobs for the deployment. Job level properties for the ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

this approach is not working:
config.Map(dest => dest.Name, src => MapContext.Current.GetService<IServive>().Format(src.User.Name))Exception appears:
InvalidOperationException: Mapping must be called using ServiceAdapteris it a bug , isn’t it ? we usually need service for complex statement it’s not only in a expression tree is there any solution else ? how can i fix it or add this feature to mapster?