public static ModelBuilder BuildTruck(this ModelBuilder modelBuilder) { var builder = BaseModelBuilder.Build <Truck>(modelBuilder, SchemaName); builder.HasKey(m => new { m.Id }); builder.Property(p => p.Id) .HasMaxLength(36) .HasConversion <Guid>() .IsRequired(); builder.Property(p => p.TruckType) .IsRequired(); builder.Property(p => p.ModelYear) .IsRequired(); builder.Property(p => p.FabricationYear) .IsRequired(); builder.Property(p => p.Name) .HasMaxLength(255); builder.Property(p => p.Plate) .HasMaxLength(10); return(modelBuilder); }
public static EntityTypeBuilder <T> Build <T>(ModelBuilder modelBuilder) where T : class, new() { return(BaseModelBuilder.Build <T>(modelBuilder, SchemaName)); }