Exemple #1
0
 public static ObjectExtensionManager MapEfCoreDbContext <TDbContext>(
     [NotNull] this ObjectExtensionManager objectExtensionManager,
     [NotNull] Action <ModelBuilder> modelBuilderAction)
     where TDbContext : DbContext
 {
     return(objectExtensionManager.AddOrUpdate(
                typeof(TDbContext),
                options =>
     {
         options.MapEfCoreDbContext(modelBuilderAction);
     }));
 }
Exemple #2
0
        public static ObjectExtensionManager MapEfCoreEntity(
            [NotNull] this ObjectExtensionManager objectExtensionManager,
            [NotNull] Type entityType,
            [NotNull] Action <EntityTypeBuilder> entityTypeBuildAction)
        {
            Check.NotNull(objectExtensionManager, nameof(objectExtensionManager));

            return(objectExtensionManager.AddOrUpdate(
                       entityType,
                       options =>
            {
                options.MapEfCoreEntity(entityTypeBuildAction);
            }));
        }
        public static ObjectExtensionManager AddOrUpdateProperty(
            [NotNull] this ObjectExtensionManager objectExtensionManager,
            [NotNull] Type objectType,
            [NotNull] Type propertyType,
            [NotNull] string propertyName,
            [CanBeNull] Action <ObjectExtensionPropertyInfo> configureAction = null)
        {
            Check.NotNull(objectExtensionManager, nameof(objectExtensionManager));

            return(objectExtensionManager.AddOrUpdate(
                       objectType,
                       options =>
            {
                options.AddOrUpdateProperty(
                    propertyType,
                    propertyName,
                    configureAction
                    );
            }));
        }