Changeset 8e74e2f for FarmatikoData/FarmatikoDataContext.cs
- Timestamp:
- 11/16/20 03:55:10 (4 years ago)
- Branches:
- master
- Children:
- db484c9
- Parents:
- 8b13eb2
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
FarmatikoData/FarmatikoDataContext.cs
r8b13eb2 r8e74e2f 7 7 { 8 8 public FarmatikoDataContext(DbContextOptions options) : base(options) { } 9 9 10 10 11 11 public virtual DbSet<HealthFacility> HealthFacilities { get; set; } … … 18 18 public virtual DbSet<User> Users { get; set; } 19 19 public virtual DbSet<PharmacyHeadMedicine> PharmacyHeadMedicines { get; set; } 20 20 21 21 protected override void OnModelCreating(ModelBuilder modelBuilder) 22 22 { 23 modelBuilder.UseSerialColumns(); 24 23 25 modelBuilder.Entity<PharmacyHead>() 24 26 .ToTable("PharmacyHeads"); … … 29 31 modelBuilder.Entity<Pharmacy>() 30 32 .ToTable("Pharmacies"); 33 34 modelBuilder.Entity<Medicine>() 35 .Property(x => x.Id) 36 .HasIdentityOptions(startValue: 1); 37 38 modelBuilder.Entity<Pharmacy>() 39 .Property(x => x.Id) 40 .HasIdentityOptions(startValue: 1); 41 42 modelBuilder.Entity<PharmacyHead>() 43 .Property(x => x.Id) 44 .HasIdentityOptions(startValue: 1); 45 46 modelBuilder.Entity<PharmacyHeadMedicine>() 47 .Property(x => x.Id) 48 .HasIdentityOptions(startValue: 1); 49 50 modelBuilder.Entity<RequestPharmacyHead>() 51 .Property(x => x.Id) 52 .HasIdentityOptions(startValue: 1); 53 54 modelBuilder.Entity<User>() 55 .Property(x => x.Id) 56 .HasIdentityOptions(startValue: 1); 31 57 32 58 modelBuilder.Entity<PharmacyHeadMedicine>() … … 47 73 .HasForeignKey(k => k.PheadId); 48 74 49 /*50 modelBuilder.Entity<CarDetails>()51 .ToTable("CarDetails");52 75 53 modelBuilder.Entity<CarDetails>()54 .Property(x => x.Type)55 .HasConversion<int>();56 57 modelBuilder.Entity<CarDetails>()58 .HasMany(x => x.ImageUrls)59 .WithOne(y => y.Car)60 .HasForeignKey(y => y.CarId);61 */62 63 /*modelBuilder.Entity<PharmacyHead>()64 .HasMany(x => x.PharmaciesList);*/65 76 66 77 base.OnModelCreating(modelBuilder);
Note:
See TracChangeset
for help on using the changeset viewer.