automapper - Automapper Compile Mappings asp.net core
问题描述
I'm using the following syntax in my asp.net core startup class to configure automapper:
services.AddAutoMapper(c => c.AllowNullCollections = true, AppDomain.CurrentDomain.GetAssemblies());
I'd like to be able to compile the mappings at startup.
According to the Automapper docs, I should be able to do so via:
var configuration = new MapperConfiguration(cfg => {});
configuration.CompileMappings();
How do I get access to the mapping configuration using AddServices syntax?
解决方案
推荐阅读
- r - 安装 r-base; 依赖:r-recommended 缺失?
- excel - 如何根据excel中的两个条件计算记录数
- php - 在laravel中选择价格总和等于或1000的所有行
- android-studio - 从 Android Studio 应用程序中的按钮播放统一?
- javascript - 选中时如何自动填充/取消选中时如何删除信息
- python - 错误只有大小为 1 的数组可以转换为 Python 标量
- python - pytest:基于每个模块的选择性日志级别
- c# - 如何在 C# 中存储来自 SOAP Web 服务的 JSON 结果?
- laravel-5 - 如何在 Laravel 中查询两个相关模型
- c# - 是否有检测换行偏好的 Roslyn 分析器?