cost 199 ms
AutoMapper从版本7升级到版本10映射问题 - Upgrading AutoMapper from version 7 to version 10 mapping problem

我在 LinqPad 5 (.Net Framework) 中完成了这个代码示例: 此代码在 AutoMapper 版本 7 中运行良好,但我已将 AutoMapper 从版本 7 升级到版本 10。现在此代码抛出错误: 我知道类 A 和 C 完全相同,但它们是从不同的 web 服务创建的,因此它们 ...

如何 map 导航属性与我正在映射的 class 类型相同? - How do I map a navigation property that is the same type as the class I'm mapping?

我正在尝试使用AutoMapper将 map 一个 class Function到另一个名为FunctionDTO的。 这些类看起来像这样: 该映射非常适用于MasterFunctionId等属性,但MasterFunction始终为 null,即使Function object 在该属性中具有值 ...

EF Core 和 Automapper 在通过 id 获取时未获取所有数据 - E.F Core and Automapper not getting all data when getting by id

我在 ASP.NET CORE api 中使用 EF Core 和 Auto Mapper,但我在理解为什么通过 ID 获取数据时没有获取所有数据时遇到了一些麻烦。 当我调试并查看数据时,它都在变量中,但是当它遇到自动映射器部分时,就像忽略了一些数据。 如何获取具有相应 Id 的所有数据。 这 ...

为什么 AutoMapper 会抛出错误 AutoMapperConfigurationException? - Why is AutoMapper throwing the error AutoMapperConfigurationException?

我有四个类 - 两个视图模型和两个实体: PhoneNumberTypeViewModel: 电话号码视图模型: 电话号码类型: 电话号码: 我使用 AutoMapper 到 map 类: 然后我尝试使用以下方法验证配置: config2 上的验证会引发以下异常: Config1 通过验证, ...

AutoMapper 9.0.0(非静态)给出缺少类型映射配置或不支持的映射错误 - AutoMapper 9.0.0 (non static) gives Missing type map configuration or unsupported mapping error

我有一个 ASP.Net Web API,它使用带有静态映射的 Automapper 7.0.1。 我最近升级到没有静态映射的 Automapper 9.0.0。 因此,我使用推荐的方式使用我的依赖容器(Unity Container)将IMapper和IConfigurationProvider的 ...

属性具有相同代码时,使AutoMapper ProjectTo()保持干燥 - Keeping AutoMapper ProjectTo() DRY When Properties Have the Same Code

我想使用AutoMapper的可查询扩展名( .ProjectTo ),但如果不将代码复制到数据库对象的许多属性中并将其复制到投影中,就无法解决该问题。 这是一个同时覆盖ToString并具有自定义属性的示例: class Claim { public int Id { get; set ...

什么是等效于使用AutoMapper 7.0.1在CreateMap中使用“静态” Mapper.Map的“实例”? - What is the “instance” equivalent to using the “static” Mapper.Map inside CreateMap using AutoMapper 7.0.1?

我正在尝试升级到不再使用静态方法的AutoMapper 7.0.1。 我收到以下错误: 映射器未初始化。 用适当的配置调用初始化。 如果您尝试通过容器或其他方式使用mapper实例,请确保没有对静态Mapper.Map方法的任何调用,并且如果您使用的是ProjectTo或UseA ...


 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM