Ignore:
Timestamp:
11/16/20 03:55:10 (3 years ago)
Author:
DimitarSlezenkovski <dslezenkovski@…>
Branches:
master
Children:
db484c9
Parents:
8b13eb2
Message:

Fix bugs, add some more.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • FarmatikoData/FarmatikoDataContext.cs

    r8b13eb2 r8e74e2f  
    77    {
    88        public FarmatikoDataContext(DbContextOptions options) : base(options) { }
    9        
     9
    1010
    1111        public virtual DbSet<HealthFacility> HealthFacilities { get; set; }
     
    1818        public virtual DbSet<User> Users { get; set; }
    1919        public virtual DbSet<PharmacyHeadMedicine> PharmacyHeadMedicines { get; set; }
    20        
     20
    2121        protected override void OnModelCreating(ModelBuilder modelBuilder)
    2222        {
     23            modelBuilder.UseSerialColumns();
     24
    2325            modelBuilder.Entity<PharmacyHead>()
    2426                .ToTable("PharmacyHeads");
     
    2931            modelBuilder.Entity<Pharmacy>()
    3032                .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);
    3157
    3258            modelBuilder.Entity<PharmacyHeadMedicine>()
     
    4773                .HasForeignKey(k => k.PheadId);
    4874
    49             /*
    50                 modelBuilder.Entity<CarDetails>()
    51             .ToTable("CarDetails");
    5275
    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);*/
    6576
    6677            base.OnModelCreating(modelBuilder);
Note: See TracChangeset for help on using the changeset viewer.