private void ConfigureMapper(IMapperConfigurationExpression cfg) { cfg.AddCollectionMappers(); cfg.CreateMap <ThingDto, Thing>().ReverseMap(); cfg.SetGeneratePropertyMaps <GenerateEntityFrameworkPrimaryKeyPropertyMaps <DB> >(); }
public static void SetGeneratePropertyMaps <TGeneratePropertyMaps>(this IMapperConfigurationExpression cfg) where TGeneratePropertyMaps : IGeneratePropertyMaps, new() { cfg.SetGeneratePropertyMaps(new TGeneratePropertyMaps()); }
/// <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));