private void ConfigureMapper(IMapperConfigurationExpression cfg)
 {
     cfg.AddCollectionMappers();
     cfg.CreateMap <ThingDto, Thing>().ReverseMap();
     cfg.SetGeneratePropertyMaps <GenerateEntityFrameworkPrimaryKeyPropertyMaps <DB> >();
 }
Beispiel #2
0
 public static void SetGeneratePropertyMaps <TGeneratePropertyMaps>(this IMapperConfigurationExpression cfg)
     where TGeneratePropertyMaps : IGeneratePropertyMaps, new()
 {
     cfg.SetGeneratePropertyMaps(new TGeneratePropertyMaps());
 }
Beispiel #3
0
 /// <summary>
 /// Generates and adds property maps based on the primary keys for the given <see cref="DbContext"/>. This method is generally
 /// only used if you are using <see cref="DbContextOptionsBuilder.UseModel(IModel)"/>.
 /// </summary>
 public static void UseEntityFrameworkCoreModel <TContext>(this IMapperConfigurationExpression config, IModel model)
     where TContext : DbContext => config.SetGeneratePropertyMaps(new GenerateEntityFrameworkCorePrimaryKeyPropertyMaps <TContext>(model));