protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     foreach (var relationship in modelBuilder.Model.GetEntityTypes().SelectMany(e => e.GetForeignKeys()))
     {
         relationship.DeleteBehavior = DeleteBehavior.Restrict;
     }
 }
Beispiel #2
1
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<LpaUser>(e =>
            {
                e.Key(p => p.Id);

                e.Property(p => p.Id).UseSqlServerSequenceHiLo("LpaUserSeq", "dbo");
                e.Property(p => p.Username).MaxLength(120).Required();
                e.Property(p => p.Password).MaxLength(150).Required();
                e.Property(p => p.PasswordSalt).MaxLength(100).Required();
                e.Property(p => p.Created).Required().ValueGeneratedNever().HasSqlServerDefaultValueSql("sysdatetime()");

                e.Collection(p => p.Claims).InverseReference(p => p.User);
                e.ToSqlServerTable("Users");
            });

            modelBuilder.Entity<LpaUserClaim>(e =>
            {
                e.Key(p=>new { p.UserId, p.ClaimId }).SqlServerClustered();
                e.Reference(p => p.Claim).InverseCollection(p => p.Users).Required();
                e.Reference(p => p.User).InverseCollection(p => p.Claims).Required();
                e.ToSqlServerTable("UserClaims");
            });

            modelBuilder.Entity<LpaClaim>(e =>
            {
                e.Key(p => p.Id).SqlServerClustered();
                e.Property(p => p.Name).MaxLength(125).Required();
                e.Property(p => p.Value).MaxLength(150).Required();
                e.Collection(p => p.Users).InverseReference(p => p.Claim);
                e.ToSqlServerTable("Claims");
            });
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rtm-21431");

            modelBuilder.Entity("Sannel.House.Thermostat.Base.Models.Device", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("DateCreated");

                    b.Property<DateTime>("DateModified");

                    b.Property<string>("Description");

                    b.Property<int>("DisplayOrder");

                    b.Property<bool>("IsReadOnly");

                    b.Property<string>("Name");

                    b.HasKey("Id");

                    b.ToTable("Devices");
                });
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.UseSqlServerIdentityColumns();

            modelBuilder.Entity<ExamInstance>(
                e =>
                {
                    e.Property(p => p.Id).HasColumnName("ExamInstanceId");
                }
            );

            modelBuilder.Entity<ExamInstanceQuestion>(
                e =>
                {
                    e.Property(p => p.Id).HasColumnName("ExamInstanceQuestionId");
                }
            );

            modelBuilder.Entity<Question>(
                e =>
                {
                    e.Property(p => p.Id).HasColumnName("QuestionId");
                }
            );
        }
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     modelBuilder.Entity<KettleChips>()
         .Property(e => e.BestBuyDate)
         .StoreGeneratedPattern(StoreGeneratedPattern.Identity)
         .DefaultValue(new DateTime(2035, 9, 25));
 }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rc2-20901")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("ToDo.Core.Models.ToDoItem", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("CreatedBy")
                        .IsRequired();

                    b.Property<DateTime>("CreatedDate");

                    b.Property<string>("Description")
                        .IsRequired();

                    b.Property<bool>("IsComplete");

                    b.Property<string>("Title")
                        .HasAnnotation("MaxLength", 25);

                    b.Property<string>("UpdatedBy");

                    b.Property<DateTime>("UpdatedDate");

                    b.HasKey("Id");

                    b.ToTable("ToDoItems");
                });
        }
        public override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);

            modelBuilder.Entity<CustomerOrderHistory>().HasKey(coh => coh.ProductName);
            modelBuilder.Entity<MostExpensiveProduct>().HasKey(mep => mep.TenMostExpensiveProducts);
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("BPE.Players.Player", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("CreationTime");

                    b.Property<string>("FirstName");

                    b.Property<DateTime?>("LastModificationTime");

                    b.Property<string>("LastName");

                    b.Property<int>("LoginCount");

                    b.HasKey("Id");

                    b.ToTable("Players");
                });
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.0-rc1-16348")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Truewheelers.Models.Bicycles", b =>
                {
                    b.Property<int>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Brand");

                    b.Property<string>("Colour");

                    b.Property<string>("Model");

                    b.Property<double>("Price");

                    b.Property<int>("Size");

                    b.HasKey("ID");
                });

            modelBuilder.Entity("Truewheelers.Models.ShoppingCart", b =>
                {
                    b.Property<int>("ID")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("itemID");

                    b.HasKey("ID");
                });
        }
        public void RegisterModels(ModelBuilder modelbuilder)
        {
            modelbuilder.Entity<Dictionary>(etb =>
            {
              etb.HasKey(e => e.Id);
              etb.Property(e => e.Id).UseSqlServerIdentityColumn();
              etb.ForSqlServerToTable("Dictionaries");
            }
              );

              modelbuilder.Entity<Culture>(etb =>
            {
              etb.HasKey(e => e.Id);
              etb.Property(e => e.Id).UseSqlServerIdentityColumn();
              etb.ForSqlServerToTable("Cultures");
            }
              );

              modelbuilder.Entity<Localization>(etb =>
            {
              etb.HasKey(e => e.Id);
              etb.Property(e => e.Id).UseSqlServerIdentityColumn();
              etb.ForSqlServerToTable("Localizations");
            }
              );
        }
        public override void BuildModel(ModelBuilder builder)
        {
            builder
                .Annotation("ProductVersion", "7.0.0-beta6-13815");

            builder.Entity("EF7ProjectLemon.Auth", b =>
                {
                    b.Property<int>("AuthId")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Login");

                    b.Key("AuthId");
                });

            builder.Entity("EF7ProjectLemon.Person", b =>
                {
                    b.Property<int>("PersonId")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Name");

                    b.Key("PersonId");
                });
        }
        public void NotMappedAttribute_ignores_entityTypes_with_conventional_builder()
        {
            var modelBuilder = new ModelBuilder(new CoreConventionSetBuilder().CreateConventionSet());
            modelBuilder.Entity<B>();

            Assert.Equal(1, modelBuilder.Model.EntityTypes.Count);
        }
        protected Model CreateModel()
        {
            var modelBuilder = new ModelBuilder(new ConventionSet());

            modelBuilder.Entity<MappingQueryTestBase.MappedCustomer>(e =>
                {
                    e.Key(c => c.CustomerID);
                    e.Property(c => c.CompanyName2).Metadata.Relational().Column = "Broken";
                    e.Metadata.Relational().Table = "Broken";
                    if (!string.IsNullOrEmpty(DatabaseSchema))
                    {
                        e.Metadata.Relational().Schema = "wrong";
                    }
                });

            modelBuilder.Entity<MappingQueryTestBase.MappedEmployee>(e =>
                {
                    e.Key(em => em.EmployeeID);
                    e.Property(em => em.City2).Metadata.Relational().Column = "City";
                    e.Metadata.Relational().Table = "Employees";
                    e.Metadata.Relational().Schema = DatabaseSchema;
                });

            modelBuilder.Entity<MappingQueryTestBase.MappedOrder>(e =>
                {
                    e.Key(o => o.OrderID);
                    e.Property(em => em.ShipVia2).Metadata.Relational().Column = "ShipVia";
                    e.Metadata.Relational().Table = "Orders";
                    e.Metadata.Relational().Schema = DatabaseSchema;
                });

            OnModelCreating(modelBuilder);

            return modelBuilder.Model;
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            //Ignores
            modelBuilder.Ignore<DataPoint>();
            modelBuilder.Ignore<MarketsAndNews>();
            modelBuilder.Ignore<MarketQuotes>();
            modelBuilder.Ignore<OperationStatus>();
            modelBuilder.Ignore<TickerQuote>();
            modelBuilder.Ignore<Security>();

            // Map these class names to the table names in the DB for Table Per Type (TPT)
            // Currently not supported in EF7

            //modelBuilder.Entity<Security>().ToTable("Security");
            //modelBuilder.Entity<Stock>().ToTable("Stock");
            //modelBuilder.Entity<MutualFund>().ToTable("MutualFund");

            //Create one to many relationship between Customer/BrokerageAccounts
            //modelBuilder.Entity<Customer>()
            //    .Collection(c => c.BrokerageAccounts)
            //    .InverseReference(ba => ba.Customer)
            //    .ForeignKey(ba => ba.CustomerId);

            //modelBuilder.Entity<BrokerageAccount>()
            //    .Collection(ba => ba.Positions)
            //    .InverseReference(p => p.BrokerageAccount)
            //    .ForeignKey(p => p.BrokerageAccountId);
        }
        public override void BuildModel(ModelBuilder builder)
        {
            builder
                .Annotation("ProductVersion", "7.0.0-beta6-13815");

            builder.Entity("OoadProjekatBaza.RestoranBaza.Models.Restoran", b =>
                {
                    b.Property<int>("RestoranId")
                        .ValueGeneratedOnAdd();

                    b.Property<float>("GeoDuzina");

                    b.Property<float>("GeoSirina");

                    b.Property<string>("Naziv");

                    b.Property<string>("Opis");

                    b.Property<float>("Rating");

                    b.Property<byte[]>("Slika")
                        .Annotation("Relational:ColumnType", "image");

                    b.Property<string>("Telefon");

                    b.Property<string>("fourSqaureId");

                    b.Key("RestoranId");
                });
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.0-rc1-16348")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("ASP.NET_Core_SPAs.Models.Contact", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("EmailAddress")
                        .HasAnnotation("MaxLength", 200);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasAnnotation("MaxLength", 200);

                    b.Property<string>("PhoneNumber");

                    b.Property<string>("UserId");

                    b.HasKey("Id");
                });
        }
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     // Make Blog.Url required
     modelBuilder.Entity<Blog>()
         .Property(b => b.Url)
         .IsRequired();
 }
Beispiel #18
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            _logger.LogInformation("[{0}]: Mapping Records to DB Context", GetType().Name);
            var sw = Stopwatch.StartNew();

            var entityMethod = modelBuilder.GetType().GetRuntimeMethod("Entity", new Type[0]);

            foreach (var assembly in _assemblyProvider.CandidateAssemblies.Distinct()) {
                // Keep persistent attribute, but also introduce a convention like ContentPart
                var entityTypes = assembly
                    .ExportedTypes
                    .Where(t =>
                        typeof(StorageDocument).IsAssignableFrom(t) &&
                        !t.GetTypeInfo().IsAbstract &&
                        !t.GetTypeInfo().IsInterface);

                foreach (var type in entityTypes) {
                    _logger.LogDebug("Mapping record {0}", type.FullName);

                    entityMethod.MakeGenericMethod(type)
                        .Invoke(modelBuilder, new object[0]);
                }
            }

            sw.Stop();
            _logger.LogInformation("[{0}]: Records Mapped in {1}ms", GetType().Name, sw.ElapsedMilliseconds);
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.1.0-rtm-22752")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Domain.Bag", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Description");

                    b.Property<string>("Factory");

                    b.Property<string>("ImageLink");

                    b.Property<string>("Name");

                    b.Property<string>("Owner");

                    b.Property<int>("Price");

                    b.Property<DateTime?>("TimeBought");

                    b.Property<DateTime>("TimeCreation");

                    b.HasKey("Id");

                    b.ToTable("Bags");
                });
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.1")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("hwnn.Models.Contact", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("FirstName");

                    b.Property<string>("LastName");

                    b.HasKey("Id");

                    b.ToTable("Contacts");
                });

            modelBuilder.Entity("hwnn.Models.Customer", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("CustomerName");

                    b.HasKey("Id");

                    b.ToTable("Customers");
                });
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<AspNetUserLogins>()
                 .HasKey(k => new { k.LoginProvider, k.ProviderKey, k.UserId });

            modelBuilder.Entity<AspNetUserRoles>()
                 .HasKey(k => new { k.UserId, k.RoleId });

            modelBuilder.Entity<AspNetUserRoles>()
                .HasOne(ur => ur.User)
                .WithMany(u => u.AspNetUserRoles)
                .HasForeignKey(ur => ur.UserId);

            modelBuilder.Entity<AspNetUserRoles>()
                .HasOne(ur => ur.Role)
                .WithMany(r => r.AspNetUserRoles)
                .HasForeignKey(ur => ur.RoleId);


            modelBuilder.Entity<C__MigrationHistory>().HasKey(k => k.MigrationId);
 

         /*   modelBuilder.Entity<AspNetUsers>()
                .HasMany(e => e.AspNetUserClaims)
                .WithRequired(e => e.AspNetUsers)
                .HasForeignKey(e => e.UserId);

            modelBuilder.Entity<AspNetUsers>()
                .HasMany(e => e.AspNetUserLogins)
                .WithRequired(e => e.AspNetUsers)
                .HasForeignKey(e => e.UserId);*/

            
            base.OnModelCreating(modelBuilder);
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rc2-20901")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Haufwerk.Models.Issue", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("AdditionalInfo");

                    b.Property<DateTime>("CreationDateTime");

                    b.Property<bool>("Ignore");

                    b.Property<string>("Message");

                    b.Property<Guid?>("ParentId");

                    b.Property<string>("Source");

                    b.Property<string>("StackTrace");

                    b.Property<string>("User");

                    b.HasKey("Id");

                    b.ToTable("Issues");
                });
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder) {
            modelBuilder.Entity<Category>(entity => {
                entity.HasIndex(e => e.CategoryName).HasName("CategoryName");

                entity.Property(e => e.Description).HasColumnType("ntext");

                entity.Property(e => e.Picture).HasColumnType("image");
            });

            modelBuilder.Entity<Order_Details>(entity => {
                entity.HasKey(e => new { e.OrderID, e.ProductID });

                entity.Property(e => e.Discount).HasDefaultValueSql("0");

                entity.Property(e => e.Quantity).HasDefaultValueSql("1");

                entity.Property(e => e.UnitPrice).HasDefaultValueSql("0");
            });

            modelBuilder.Entity<Order>(entity => {
                entity.Property(e => e.Freight).HasDefaultValueSql("0");
            });

            modelBuilder.Entity<Product>(entity => {
                entity.Property(e => e.Discontinued).HasDefaultValueSql("0");

                entity.Property(e => e.ReorderLevel).HasDefaultValueSql("0");

                entity.Property(e => e.UnitPrice).HasDefaultValueSql("0");

                entity.Property(e => e.UnitsInStock).HasDefaultValueSql("0");

                entity.Property(e => e.UnitsOnOrder).HasDefaultValueSql("0");
            });
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rtm-21431")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("WebApi_Identity_Provider_DotNet.Models.Credential", b =>
                {
                    b.Property<string>("UserId")
                        .HasAnnotation("MaxLength", 256);

                    b.Property<string>("PublicKeyHash");

                    b.Property<string>("ActiveChallenge");

                    b.Property<string>("DeviceName")
                        .IsRequired();

                    b.Property<string>("PublicKey")
                        .IsRequired();

                    b.HasKey("UserId", "PublicKeyHash");

                    b.ToTable("Credentials");
                });
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "7.0.0-beta8-15964")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Dorothy.Models.Guest", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("AdultCount");

                    b.Property<int>("ChildCount");

                    b.Property<string>("Group");

                    b.Property<bool>("HasEmail");

                    b.Property<bool>("HasInvitation");

                    b.Property<bool>("IsOptional");

                    b.Property<string>("Names");

                    b.Property<string>("Notes");

                    b.HasKey("Id");
                });
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .Annotation("ProductVersion", "7.0.0-beta8-15964")
                .Annotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("PhoneSpotter.Models.PhoneSpotting", b =>
                {
                    b.Property<int>("PhoneSpottingId")
                        .ValueGeneratedOnAdd();

                    b.Property<double>("Latitude");

                    b.Property<double>("Longitude");

                    b.Property<string>("Notes");

                    b.Property<string>("PhoneManufacturer");

                    b.Property<string>("PhoneModel");

                    b.Property<DateTime>("SpotTime");

                    b.HasKey("PhoneSpottingId");
                });
        }
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     modelBuilder.Entity<Parent>()
         .HasMany(b => b.Children)
         .WithOne(b => b.MyParent)
         .HasForeignKey(b => b.ParentId);
 }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.0-rc2-20901");

            modelBuilder.Entity("LinkThere.Models.Link", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("ClickCount")
                        .IsConcurrencyToken();

                    b.Property<string>("Key")
                        .IsRequired();

                    b.Property<string>("LinkUrl")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("Key")
                        .IsUnique();

                    b.ToTable("Links");
                });
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
            modelBuilder
                .HasAnnotation("ProductVersion", "1.0.1");

            modelBuilder.Entity("cloudscribe.Core.IdentityServer.EFCore.Entities.PersistedGrant", b =>
                {
                    b.Property<string>("Key");

                    b.Property<string>("Type");

                    b.Property<string>("ClientId")
                        .IsRequired()
                        .HasAnnotation("MaxLength", 200);

                    b.Property<DateTime>("CreationTime");

                    b.Property<string>("Data")
                        .IsRequired();

                    b.Property<DateTime>("Expiration");

                    b.Property<string>("SiteId")
                        .IsRequired()
                        .HasAnnotation("MaxLength", 36);

                    b.Property<string>("SubjectId");

                    b.HasKey("Key", "Type");

                    b.HasIndex("SiteId");

                    b.ToTable("csids_PersistedGrants");
                });
        }
Beispiel #30
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<User>().ToTable("Users");
            modelBuilder.Entity<User>().HasKey(c => c.UserId);
            modelBuilder.Entity<User>().Property(c => c.UserId).HasColumnName("Id");
            modelBuilder.Entity<User>().Property(x=> x.Identifier).HasColumnName("Login");
            modelBuilder.Entity<User>().Property(x=> x.Name).HasColumnName("Name");
            modelBuilder.Entity<User>().Property(x=> x.Email).HasColumnName("Email");
            modelBuilder.Entity<User>().Property(x=> x.IsSurveyor).HasColumnName("isSurveyor");
            modelBuilder.Entity<User>().Property(x=> x.Password).HasColumnName("Password");
            modelBuilder.Entity<User>().Property(x=> x.Status).HasColumnName("Status");

            // mappings for orgs...

            modelBuilder.Entity<Organization>().ToTable("Organizations");
            modelBuilder.Entity<Organization>().HasKey(x => x.OrganizationId);
            modelBuilder.Entity<Organization>().Property(x => x.OrganizationId).HasColumnName("ID");
            modelBuilder.Entity<Organization>().Property(x => x.Identifier).HasColumnName("Identifier");
            modelBuilder.Entity<Organization>().Property(x => x.Name).HasColumnName("Name");
            modelBuilder.Entity<Organization>().Property(x => x.Email).HasColumnName("Email");
            modelBuilder.Entity<Organization>().Property(x => x.BillingEmail).HasColumnName("BillingEmail");
            modelBuilder.Entity<Organization>().Property(x => x.CreatedAt).HasColumnName("FirstAdded");
            modelBuilder.Entity<Organization>().Property(x => x.Type).HasColumnName("Type");
            modelBuilder.Entity<Organization>().Ignore(x => x.Status);//.HasColumnName("Status");
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.1.14-servicing-32113")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Blog.Models.Category", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Name");

                    b.HasKey("Id");

                    b.ToTable("Categories");
                });

            modelBuilder.Entity("Blog.Models.Post", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Body");

                    b.Property<int>("CategoryId");

                    b.Property<DateTime>("Created");

                    b.Property<string>("Description");

                    b.Property<string>("Image");

                    b.Property<string>("Tags");

                    b.Property<string>("Title");

                    b.HasKey("Id");

                    b.HasIndex("CategoryId");

                    b.ToTable("Posts");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Name")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasName("RoleNameIndex")
                        .HasFilter("[NormalizedName] IS NOT NULL");

                    b.ToTable("AspNetRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("RoleId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("AccessFailedCount");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Email")
                        .HasMaxLength(256);

                    b.Property<bool>("EmailConfirmed");

                    b.Property<bool>("LockoutEnabled");

                    b.Property<DateTimeOffset?>("LockoutEnd");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256);

                    b.Property<string>("PasswordHash");

                    b.Property<string>("PhoneNumber");

                    b.Property<bool>("PhoneNumberConfirmed");

                    b.Property<string>("SecurityStamp");

                    b.Property<bool>("TwoFactorEnabled");

                    b.Property<string>("UserName")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasName("UserNameIndex")
                        .HasFilter("[NormalizedUserName] IS NOT NULL");

                    b.ToTable("AspNetUsers");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider");

                    b.Property<string>("ProviderKey");

                    b.Property<string>("ProviderDisplayName");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("RoleId");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("LoginProvider");

                    b.Property<string>("Name");

                    b.Property<string>("Value");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens");
                });

            modelBuilder.Entity("Blog.Models.Post", b =>
                {
                    b.HasOne("Blog.Models.Category", "Category")
                        .WithMany("Posts")
                        .HasForeignKey("CategoryId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
 protected override void OnModelCreating(ModelBuilder builder)
 { base.OnModelCreating(builder);
 
 }
 protected override void OnModelCreating(ModelBuilder builder)
 {
     base.OnModelCreating(builder);
     builder.Entity<Organization>(org => { org.ToTable("Organizations"); org.HasKey(x => x.Id); org.HasMany<Profile>().WithOne().HasForeignKey(x => x.OrgId).IsRequired(false); });
 }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.0.1-rtm-125")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("stockportfolio.Models.Stock", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Currency");

                    b.Property<string>("Name");

                    b.Property<int>("StockExchangeID");

                    b.Property<string>("Symbol");

                    b.HasKey("Id");

                    b.HasIndex("StockExchangeID");

                    b.ToTable("Stock");
                });

            modelBuilder.Entity("stockportfolio.Models.StockExchange", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Name");

                    b.Property<string>("Symbol");

                    b.HasKey("Id");

                    b.ToTable("StockExchange");
                });

            modelBuilder.Entity("stockportfolio.Models.User", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Email")
                        .IsRequired();

                    b.Property<string>("FirstName")
                        .IsRequired();

                    b.Property<string>("LastName")
                        .IsRequired();

                    b.HasKey("Id");

                    b.ToTable("User");
                });

            modelBuilder.Entity("stockportfolio.Models.UserStock", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("Amount");

                    b.Property<DateTime>("PurchaseDate");

                    b.Property<double>("PurchasePrice");

                    b.Property<int>("StockId");

                    b.Property<int>("UserId");

                    b.HasKey("Id");

                    b.HasIndex("StockId");

                    b.HasIndex("UserId");

                    b.ToTable("UserStock");
                });

            modelBuilder.Entity("stockportfolio.Models.Stock", b =>
                {
                    b.HasOne("stockportfolio.Models.StockExchange", "StockExchange")
                        .WithMany("Stocks")
                        .HasForeignKey("StockExchangeID")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("stockportfolio.Models.UserStock", b =>
                {
                    b.HasOne("stockportfolio.Models.Stock", "Stock")
                        .WithMany()
                        .HasForeignKey("StockId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("stockportfolio.Models.User", "User")
                        .WithMany("UserStocks")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "5.0.1");

            modelBuilder.Entity("Domain.Activity", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("TEXT");

                    b.Property<string>("Category")
                        .HasColumnType("TEXT");

                    b.Property<string>("City")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("Date")
                        .HasColumnType("TEXT");

                    b.Property<string>("Description")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsCancelled")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Title")
                        .HasColumnType("TEXT");

                    b.Property<string>("Venue")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.ToTable("Activities");
                });

            modelBuilder.Entity("Domain.ActivityAttendee", b =>
                {
                    b.Property<string>("AppUserId")
                        .HasColumnType("TEXT");

                    b.Property<Guid>("ActivityId")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsHost")
                        .HasColumnType("INTEGER");

                    b.HasKey("AppUserId", "ActivityId");

                    b.HasIndex("ActivityId");

                    b.ToTable("ActivityAttendees");
                });

            modelBuilder.Entity("Domain.AppUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("TEXT");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Bio")
                        .HasColumnType("TEXT");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("TEXT");

                    b.Property<string>("DisplayName")
                        .HasColumnType("TEXT");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("INTEGER");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("INTEGER");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("TEXT");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("TEXT");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("TEXT");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("INTEGER");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("TEXT");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("INTEGER");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.ToTable("AspNetUsers");
                });

            modelBuilder.Entity("Domain.Comment", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<Guid?>("ActivityId")
                        .HasColumnType("TEXT");

                    b.Property<string>("AuthorId")
                        .HasColumnType("TEXT");

                    b.Property<string>("Body")
                        .HasColumnType("TEXT");

                    b.Property<DateTime>("CreatedAt")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("ActivityId");

                    b.HasIndex("AuthorId");

                    b.ToTable("Comments");
                });

            modelBuilder.Entity("Domain.Photo", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("AppUserId")
                        .HasColumnType("TEXT");

                    b.Property<bool>("IsMain")
                        .HasColumnType("INTEGER");

                    b.Property<string>("Url")
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("AppUserId");

                    b.ToTable("Photos");
                });

            modelBuilder.Entity("Domain.UserFollowing", b =>
                {
                    b.Property<string>("ObserverId")
                        .HasColumnType("TEXT");

                    b.Property<string>("TargetId")
                        .HasColumnType("TEXT");

                    b.HasKey("ObserverId", "TargetId");

                    b.HasIndex("TargetId");

                    b.ToTable("UserFollowings");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("TEXT");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("ClaimType")
                        .HasColumnType("TEXT");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("TEXT");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("INTEGER");

                    b.Property<string>("ClaimType")
                        .HasColumnType("TEXT");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("TEXT");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasColumnType("TEXT");

                    b.Property<string>("ProviderKey")
                        .HasColumnType("TEXT");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("TEXT");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("TEXT");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("TEXT");

                    b.Property<string>("RoleId")
                        .HasColumnType("TEXT");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("TEXT");

                    b.Property<string>("LoginProvider")
                        .HasColumnType("TEXT");

                    b.Property<string>("Name")
                        .HasColumnType("TEXT");

                    b.Property<string>("Value")
                        .HasColumnType("TEXT");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens");
                });

            modelBuilder.Entity("Domain.ActivityAttendee", b =>
                {
                    b.HasOne("Domain.Activity", "Activity")
                        .WithMany("Attendees")
                        .HasForeignKey("ActivityId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Domain.AppUser", "AppUser")
                        .WithMany("Activities")
                        .HasForeignKey("AppUserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Activity");

                    b.Navigation("AppUser");
                });

            modelBuilder.Entity("Domain.Comment", b =>
                {
                    b.HasOne("Domain.Activity", "Activity")
                        .WithMany("Comments")
                        .HasForeignKey("ActivityId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("Domain.AppUser", "Author")
                        .WithMany()
                        .HasForeignKey("AuthorId");

                    b.Navigation("Activity");

                    b.Navigation("Author");
                });

            modelBuilder.Entity("Domain.Photo", b =>
                {
                    b.HasOne("Domain.AppUser", null)
                        .WithMany("Photos")
                        .HasForeignKey("AppUserId");
                });

            modelBuilder.Entity("Domain.UserFollowing", b =>
                {
                    b.HasOne("Domain.AppUser", "Observer")
                        .WithMany("Followings")
                        .HasForeignKey("ObserverId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Domain.AppUser", "Target")
                        .WithMany("Followers")
                        .HasForeignKey("TargetId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.Navigation("Observer");

                    b.Navigation("Target");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Domain.AppUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Domain.AppUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Domain.AppUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("Domain.AppUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Domain.Activity", b =>
                {
                    b.Navigation("Attendees");

                    b.Navigation("Comments");
                });

            modelBuilder.Entity("Domain.AppUser", b =>
                {
                    b.Navigation("Activities");

                    b.Navigation("Followers");

                    b.Navigation("Followings");

                    b.Navigation("Photos");
                });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn)
                .HasAnnotation("ProductVersion", "3.0.0")
                .HasAnnotation("Relational:MaxIdentifierLength", 63);

            modelBuilder.Entity("TITS_API.Models.Models.Ingredient", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn);

                    b.Property<string>("EnglishName")
                        .HasColumnType("text");

                    b.Property<string>("MolecularFormula")
                        .HasColumnType("text");

                    b.Property<string>("PolishName")
                        .HasColumnType("text");

                    b.Property<int?>("PubChemID")
                        .HasColumnType("integer");

                    b.Property<string>("PubChemUrl")
                        .HasColumnType("text");

                    b.Property<string>("ToxicityGrade")
                        .HasColumnType("text");

                    b.Property<string>("WikiUrl")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Ingredients");
                });

            modelBuilder.Entity("TITS_API.Models.Models.Product", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn);

                    b.Property<string>("BrandName")
                        .HasColumnType("text");

                    b.Property<string>("BrandOwner")
                        .HasColumnType("text");

                    b.Property<string>("CountryOfOrigin")
                        .HasColumnType("text");

                    b.Property<string>("Description")
                        .HasColumnType("text");

                    b.Property<string>("Gtin")
                        .HasColumnType("text");

                    b.Property<string>("ItemName")
                        .HasColumnType("text");

                    b.Property<string>("ManufacturerName")
                        .HasColumnType("text");

                    b.Property<string>("Picture")
                        .HasColumnType("text");

                    b.Property<string>("Url")
                        .HasColumnType("text");

                    b.HasKey("Id");

                    b.ToTable("Products");
                });

            modelBuilder.Entity("TITS_API.Models.Models.ProductComposition", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("integer")
                        .HasAnnotation("Npgsql:ValueGenerationStrategy", NpgsqlValueGenerationStrategy.SerialColumn);

                    b.Property<int>("IngredientId")
                        .HasColumnType("integer");

                    b.Property<int>("ProductId")
                        .HasColumnType("integer");

                    b.HasKey("Id");

                    b.HasIndex("IngredientId");

                    b.HasIndex("ProductId");

                    b.ToTable("ProductCompositions");
                });

            modelBuilder.Entity("TITS_API.Models.Models.ProductComposition", b =>
                {
                    b.HasOne("TITS_API.Models.Models.Ingredient", "Ingredient")
                        .WithMany()
                        .HasForeignKey("IngredientId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("TITS_API.Models.Models.Product", "Product")
                        .WithMany()
                        .HasForeignKey("ProductId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });
#pragma warning restore 612, 618
        }
Beispiel #37
0
 partial void OnModelCreatingPartial(ModelBuilder modelBuilder);
Beispiel #38
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Anuncio>(entity =>
            {
                entity.ToTable("anuncio");

                entity.Property(e => e.Anuncioid)
                    .HasColumnName("anuncioid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Mensaje)
                    .IsRequired()
                    .HasColumnName("mensaje")
                    .HasColumnType("character varying");

                entity.Property(e => e.Tecnicoid).HasColumnName("tecnicoid");

                entity.Property(e => e.Titulo)
                    .IsRequired()
                    .HasColumnName("titulo")
                    .HasColumnType("character varying");

                entity.HasOne(d => d.Tecnico)
                    .WithMany(p => p.Anuncio)
                    .HasForeignKey(d => d.Tecnicoid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_tecnicoid");
            });

            modelBuilder.Entity<Banca>(entity =>
            {
                entity.ToTable("banca");

                entity.Property(e => e.Bancaid)
                    .HasColumnName("bancaid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Banco)
                    .IsRequired()
                    .HasColumnName("banco")
                    .HasColumnType("character varying");

                entity.Property(e => e.Cuenta)
                    .IsRequired()
                    .HasColumnName("cuenta")
                    .HasColumnType("character varying");
            });

            modelBuilder.Entity<Categoria>(entity =>
            {
                entity.ToTable("categoria");

                entity.Property(e => e.Categoriaid)
                    .HasColumnName("categoriaid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Nombre)
                    .IsRequired()
                    .HasColumnName("nombre")
                    .HasColumnType("character varying");
            });

            modelBuilder.Entity<Cliente>(entity =>
            {
                entity.ToTable("cliente");

                entity.Property(e => e.Clienteid)
                    .HasColumnName("clienteid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Bancaid).HasColumnName("bancaid");

                entity.Property(e => e.Correo)
                    .IsRequired()
                    .HasColumnName("correo")
                    .HasColumnType("character varying");

                entity.Property(e => e.Direccion)
                    .IsRequired()
                    .HasColumnName("direccion")
                    .HasColumnType("character varying");

                entity.Property(e => e.Nombre)
                    .IsRequired()
                    .HasColumnName("nombre")
                    .HasColumnType("character varying");

                entity.Property(e => e.Telefono)
                    .IsRequired()
                    .HasColumnName("telefono")
                    .HasColumnType("character varying");

                entity.Property(e => e.Usuarioid).HasColumnName("usuarioid");

                entity.HasOne(d => d.Banca)
                    .WithMany(p => p.Cliente)
                    .HasForeignKey(d => d.Bancaid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_bancaid");

                entity.HasOne(d => d.Usuario)
                    .WithMany(p => p.Cliente)
                    .HasForeignKey(d => d.Usuarioid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_usuarioid");
            });

            modelBuilder.Entity<Contrato>(entity =>
            {
                entity.ToTable("contrato");

                entity.Property(e => e.Contratoid)
                    .HasColumnName("contratoid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Descripcion)
                    .IsRequired()
                    .HasColumnName("descripcion")
                    .HasColumnType("character varying");

                entity.Property(e => e.Tecnicoid).HasColumnName("tecnicoid");

                entity.HasOne(d => d.Tecnico)
                    .WithMany(p => p.Contrato)
                    .HasForeignKey(d => d.Tecnicoid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_tecnicoid");
            });

            modelBuilder.Entity<Cotizacion>(entity =>
            {
                entity.ToTable("cotizacion");

                entity.Property(e => e.Cotizacionid)
                    .HasColumnName("cotizacionid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Clienteid).HasColumnName("clienteid");

                entity.Property(e => e.Descripcion)
                    .IsRequired()
                    .HasColumnName("descripcion")
                    .HasColumnType("character varying");

                entity.HasOne(d => d.Cliente)
                    .WithMany(p => p.Cotizacion)
                    .HasForeignKey(d => d.Clienteid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_clienteid");
            });

            modelBuilder.Entity<Evaluacion>(entity =>
            {
                entity.ToTable("evaluacion");

                entity.Property(e => e.Evaluacionid)
                    .HasColumnName("evaluacionid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Categoriaid).HasColumnName("categoriaid");

                entity.Property(e => e.Clienteid).HasColumnName("clienteid");

                entity.Property(e => e.Comentario)
                    .IsRequired()
                    .HasColumnName("comentario")
                    .HasColumnType("character varying");

                entity.Property(e => e.Puntuacion).HasColumnName("puntuacion");

                entity.Property(e => e.Tecnicoid).HasColumnName("tecnicoid");

                entity.HasOne(d => d.Categoria)
                    .WithMany(p => p.Evaluacion)
                    .HasForeignKey(d => d.Categoriaid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_categoriaid");

                entity.HasOne(d => d.Cliente)
                    .WithMany(p => p.Evaluacion)
                    .HasForeignKey(d => d.Clienteid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_clienteid");

                entity.HasOne(d => d.Tecnico)
                    .WithMany(p => p.Evaluacion)
                    .HasForeignKey(d => d.Tecnicoid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_tecnicoid");
            });

            modelBuilder.Entity<Historialtecnico>(entity =>
            {
                entity.ToTable("historialtecnico");

                entity.Property(e => e.Historialtecnicoid)
                    .HasColumnName("historialtecnicoid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Servicioid).HasColumnName("servicioid");

                entity.Property(e => e.Tecnicoid).HasColumnName("tecnicoid");

                entity.HasOne(d => d.Servicio)
                    .WithMany(p => p.Historialtecnico)
                    .HasForeignKey(d => d.Servicioid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_servicioid");

                entity.HasOne(d => d.Tecnico)
                    .WithMany(p => p.Historialtecnico)
                    .HasForeignKey(d => d.Tecnicoid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_tecnicoid");
            });

            modelBuilder.Entity<Pago>(entity =>
            {
                entity.ToTable("pago");

                entity.Property(e => e.Pagoid)
                    .HasColumnName("pagoid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Cleinteid).HasColumnName("cleinteid");

                entity.Property(e => e.Fechadeexpiracion)
                    .IsRequired()
                    .HasColumnName("fechadeexpiracion")
                    .HasColumnType("character varying");

                entity.Property(e => e.Monto).HasColumnName("monto");

                entity.Property(e => e.Servicioid).HasColumnName("servicioid");

                entity.Property(e => e.Tarjeta)
                    .IsRequired()
                    .HasColumnName("tarjeta")
                    .HasColumnType("character varying");

                entity.Property(e => e.Tarjetahabiente)
                    .IsRequired()
                    .HasColumnName("tarjetahabiente")
                    .HasColumnType("character varying");

                entity.Property(e => e.Tecnicoid).HasColumnName("tecnicoid");

                entity.HasOne(d => d.Cleinte)
                    .WithMany(p => p.Pago)
                    .HasForeignKey(d => d.Cleinteid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_clienteid");

                entity.HasOne(d => d.Servicio)
                    .WithMany(p => p.Pago)
                    .HasForeignKey(d => d.Servicioid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_servicioid");

                entity.HasOne(d => d.Tecnico)
                    .WithMany(p => p.Pago)
                    .HasForeignKey(d => d.Tecnicoid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_tecnicoid");
            });

            modelBuilder.Entity<Servicio>(entity =>
            {
                entity.ToTable("servicio");

                entity.Property(e => e.Servicioid)
                    .HasColumnName("servicioid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Categoriaid).HasColumnName("categoriaid");

                entity.Property(e => e.Nombre)
                    .IsRequired()
                    .HasColumnName("nombre")
                    .HasColumnType("character varying");
            });

            modelBuilder.Entity<Tecnico>(entity =>
            {
                entity.ToTable("tecnico");

                entity.Property(e => e.Tecnicoid)
                    .HasColumnName("tecnicoid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Bancaid).HasColumnName("bancaid");

                entity.Property(e => e.Direccion)
                    .IsRequired()
                    .HasColumnName("direccion")
                    .HasColumnType("character varying");

                entity.Property(e => e.Nombre)
                    .IsRequired()
                    .HasColumnName("nombre")
                    .HasColumnType("character varying");

                entity.Property(e => e.Servicioid).HasColumnName("servicioid");

                entity.Property(e => e.Telefono)
                    .IsRequired()
                    .HasColumnName("telefono")
                    .HasColumnType("character varying");

                entity.Property(e => e.Usuarioid).HasColumnName("usuarioid");

                entity.HasOne(d => d.Banca)
                    .WithMany(p => p.Tecnico)
                    .HasForeignKey(d => d.Bancaid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_bancaid");

                entity.HasOne(d => d.Servicio)
                    .WithMany(p => p.Tecnico)
                    .HasForeignKey(d => d.Servicioid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_servicioid");

                entity.HasOne(d => d.Usuario)
                    .WithMany(p => p.Tecnico)
                    .HasForeignKey(d => d.Usuarioid)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("fk_usuarioid");
            });

            modelBuilder.Entity<Usuario>(entity =>
            {
                entity.ToTable("usuario");

                entity.Property(e => e.Usuarioid)
                    .HasColumnName("usuarioid")
                    .UseIdentityAlwaysColumn();

                entity.Property(e => e.Clave)
                    .IsRequired()
                    .HasColumnName("clave")
                    .HasColumnType("character varying");

                entity.Property(e => e.Correo)
                    .IsRequired()
                    .HasColumnName("correo")
                    .HasColumnType("character varying");

                entity.Property(e => e.Cuenta).HasColumnName("cuenta");

                entity.Property(e => e.Nombre)
                    .IsRequired()
                    .HasColumnName("nombre")
                    .HasColumnType("character varying");

                entity.Property(e => e.Tipo).HasColumnName("tipo");
            });

            OnModelCreatingPartial(modelBuilder);
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "3.1.8")
            .HasAnnotation("Relational:MaxIdentifierLength", 128)
            .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(256)")
                .HasMaxLength(256);

                b.Property <string>("NormalizedName")
                .HasColumnType("nvarchar(256)")
                .HasMaxLength(256);

                b.HasKey("Id");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasName("RoleNameIndex")
                .HasFilter("[NormalizedName] IS NOT NULL");

                b.ToTable("AspNetRoles");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <string>("ClaimType")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("ClaimValue")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("RoleId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.ToTable("AspNetRoleClaims");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
            {
                b.Property <string>("Id")
                .HasColumnType("nvarchar(450)");

                b.Property <int>("AccessFailedCount")
                .HasColumnType("int");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken()
                .HasColumnType("nvarchar(max)");

                b.Property <string>("Email")
                .HasColumnType("nvarchar(256)")
                .HasMaxLength(256);

                b.Property <bool>("EmailConfirmed")
                .HasColumnType("bit");

                b.Property <bool>("LockoutEnabled")
                .HasColumnType("bit");

                b.Property <DateTimeOffset?>("LockoutEnd")
                .HasColumnType("datetimeoffset");

                b.Property <string>("NormalizedEmail")
                .HasColumnType("nvarchar(256)")
                .HasMaxLength(256);

                b.Property <string>("NormalizedUserName")
                .HasColumnType("nvarchar(256)")
                .HasMaxLength(256);

                b.Property <string>("PasswordHash")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("PhoneNumber")
                .HasColumnType("nvarchar(max)");

                b.Property <bool>("PhoneNumberConfirmed")
                .HasColumnType("bit");

                b.Property <string>("SecurityStamp")
                .HasColumnType("nvarchar(max)");

                b.Property <bool>("TwoFactorEnabled")
                .HasColumnType("bit");

                b.Property <string>("UserName")
                .HasColumnType("nvarchar(256)")
                .HasMaxLength(256);

                b.HasKey("Id");

                b.HasIndex("NormalizedEmail")
                .HasName("EmailIndex");

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasName("UserNameIndex")
                .HasFilter("[NormalizedUserName] IS NOT NULL");

                b.ToTable("AspNetUsers");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <string>("ClaimType")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("ClaimValue")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserClaims");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.Property <string>("LoginProvider")
                .HasColumnType("nvarchar(128)")
                .HasMaxLength(128);

                b.Property <string>("ProviderKey")
                .HasColumnType("nvarchar(128)")
                .HasMaxLength(128);

                b.Property <string>("ProviderDisplayName")
                .HasColumnType("nvarchar(max)");

                b.Property <string>("UserId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("LoginProvider", "ProviderKey");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserLogins");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("RoleId")
                .HasColumnType("nvarchar(450)");

                b.HasKey("UserId", "RoleId");

                b.HasIndex("RoleId");

                b.ToTable("AspNetUserRoles");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId")
                .HasColumnType("nvarchar(450)");

                b.Property <string>("LoginProvider")
                .HasColumnType("nvarchar(128)")
                .HasMaxLength(128);

                b.Property <string>("Name")
                .HasColumnType("nvarchar(128)")
                .HasMaxLength(128);

                b.Property <string>("Value")
                .HasColumnType("nvarchar(max)");

                b.HasKey("UserId", "LoginProvider", "Name");

                b.ToTable("AspNetUserTokens");
            });

            modelBuilder.Entity("PathChatApp.Models.Message", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <DateTime>("CreatedTime")
                .HasColumnType("datetime2");

                b.Property <string>("MessageText")
                .HasColumnType("nvarchar(max)");

                b.Property <Guid?>("RoomId")
                .HasColumnType("uniqueidentifier");

                b.Property <string>("SenderName")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.HasIndex("RoomId");

                b.ToTable("Messages");
            });

            modelBuilder.Entity("PathChatApp.Models.Room", b =>
            {
                b.Property <Guid>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("uniqueidentifier");

                b.Property <string>("RoomName")
                .HasColumnType("nvarchar(max)");

                b.HasKey("Id");

                b.ToTable("Rooms");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();
            });

            modelBuilder.Entity("PathChatApp.Models.Message", b =>
            {
                b.HasOne("PathChatApp.Models.Room", null)
                .WithMany("Messages")
                .HasForeignKey("RoomId");
            });
#pragma warning restore 612, 618
        }
Beispiel #40
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
            .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("ApplicationCore.Entities.BasketAggregate.Basket", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("BuyerId");

                b.Property <DateTime?>("CreatedDate");

                b.Property <DateTime?>("UpdatedDate");

                b.HasKey("Id");

                b.ToTable("Basket");
            });

            modelBuilder.Entity("ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <int>("BasketId");

                b.Property <int?>("CatalogAttribute1");

                b.Property <int?>("CatalogAttribute2");

                b.Property <int?>("CatalogAttribute3");

                b.Property <int>("CatalogItemId");

                b.Property <DateTime?>("CreatedDate");

                b.Property <string>("CustomizeName")
                .HasMaxLength(100);

                b.Property <int>("Quantity");

                b.Property <decimal>("UnitPrice")
                .HasColumnType("decimal(18,2)");

                b.Property <DateTime?>("UpdatedDate");

                b.HasKey("Id");

                b.HasIndex("BasketId");

                b.ToTable("BasketItem");
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogAttribute", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <int>("CatalogItemId");

                b.Property <string>("Name");

                b.Property <int>("Stock");

                b.Property <int>("Type");

                b.HasKey("Id");

                b.HasIndex("CatalogItemId");

                b.ToTable("CatalogAttribute");
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogCategory", b =>
            {
                b.Property <int>("CatalogItemId");

                b.Property <int>("CategoryId");

                b.HasKey("CatalogItemId", "CategoryId");

                b.HasIndex("CategoryId");

                b.ToTable("CatalogCategory");
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <int>("CatalogTypeId");

                b.Property <bool>("IsFeatured");

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100);

                b.Property <string>("PictureUri");

                b.Property <decimal?>("Price")
                .HasColumnType("decimal(18,2)");

                b.Property <bool>("ShowOnShop");

                b.Property <string>("Sku")
                .HasMaxLength(255);

                b.Property <int>("Stock");

                b.HasKey("Id");

                b.HasIndex("CatalogTypeId");

                b.ToTable("Catalog");
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogType", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Code")
                .IsRequired()
                .HasMaxLength(25);

                b.Property <decimal>("Price")
                .HasColumnType("decimal(18,2)");

                b.HasKey("Id");

                b.HasIndex("Code")
                .IsUnique();

                b.ToTable("CatalogType");
            });

            modelBuilder.Entity("ApplicationCore.Entities.Category", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100);

                b.Property <int>("Order")
                .ValueGeneratedOnAdd()
                .HasDefaultValue(1);

                b.Property <int?>("ParentId");

                b.HasKey("Id");

                b.HasIndex("Name")
                .IsUnique();

                b.HasIndex("ParentId");

                b.ToTable("Category");
            });

            modelBuilder.Entity("ApplicationCore.Entities.Country", b =>
            {
                b.Property <int>("Id");

                b.Property <string>("Code")
                .IsRequired()
                .HasMaxLength(10);

                b.Property <string>("Name")
                .IsRequired()
                .HasMaxLength(100);

                b.HasKey("Id");

                b.ToTable("Country");
            });

            modelBuilder.Entity("ApplicationCore.Entities.InvoiceConfig", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <DateTime?>("LastRunDate");

                b.Property <decimal>("MaxValue");

                b.Property <int>("NrInvoices");

                b.Property <int>("Week");

                b.Property <int>("WeekState");

                b.HasKey("Id");

                b.ToTable("InvoiceConfig");
            });

            modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.Order", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("BuyerId");

                b.Property <string>("CustomerEmail");

                b.Property <DateTimeOffset>("OrderDate");

                b.Property <int>("OrderState")
                .ValueGeneratedOnAdd()
                .HasDefaultValue(0);

                b.Property <long?>("SalesInvoiceId");

                b.Property <string>("SalesInvoiceNumber")
                .HasMaxLength(255);

                b.Property <int?>("TaxNumber");

                b.HasKey("Id");

                b.ToTable("Orders");
            });

            modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("CustomizeName");

                b.Property <int?>("OrderId");

                b.Property <decimal>("UnitPrice")
                .HasColumnType("decimal(18,2)");

                b.Property <int>("Units");

                b.HasKey("Id");

                b.HasIndex("OrderId");

                b.ToTable("OrderItems");
            });

            modelBuilder.Entity("ApplicationCore.Entities.BasketAggregate.BasketItem", b =>
            {
                b.HasOne("ApplicationCore.Entities.BasketAggregate.Basket", "Basket")
                .WithMany("Items")
                .HasForeignKey("BasketId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogAttribute", b =>
            {
                b.HasOne("ApplicationCore.Entities.CatalogItem", "CatalogItem")
                .WithMany("CatalogAttributes")
                .HasForeignKey("CatalogItemId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogCategory", b =>
            {
                b.HasOne("ApplicationCore.Entities.CatalogItem", "CatalogItem")
                .WithMany("CatalogCategories")
                .HasForeignKey("CatalogItemId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("ApplicationCore.Entities.Category", "Category")
                .WithMany("CatalogCategories")
                .HasForeignKey("CategoryId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ApplicationCore.Entities.CatalogItem", b =>
            {
                b.HasOne("ApplicationCore.Entities.CatalogType", "CatalogType")
                .WithMany("CatalogItems")
                .HasForeignKey("CatalogTypeId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ApplicationCore.Entities.Category", b =>
            {
                b.HasOne("ApplicationCore.Entities.Category", "Parent")
                .WithMany()
                .HasForeignKey("ParentId");
            });

            modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.Order", b =>
            {
                b.OwnsOne("ApplicationCore.Entities.OrderAggregate.Address", "BillingToAddress", b1 =>
                {
                    b1.Property <int>("OrderId");

                    b1.Property <string>("City");

                    b1.Property <string>("Country");

                    b1.Property <string>("Name");

                    b1.Property <string>("PostalCode");

                    b1.Property <string>("Street");

                    b1.HasKey("OrderId");

                    b1.ToTable("Orders");

                    b1.HasOne("ApplicationCore.Entities.OrderAggregate.Order")
                    .WithOne("BillingToAddress")
                    .HasForeignKey("ApplicationCore.Entities.OrderAggregate.Address", "OrderId")
                    .OnDelete(DeleteBehavior.Cascade);
                });
            });

            modelBuilder.Entity("ApplicationCore.Entities.OrderAggregate.OrderItem", b =>
            {
                b.HasOne("ApplicationCore.Entities.OrderAggregate.Order")
                .WithMany("OrderItems")
                .HasForeignKey("OrderId");

                b.OwnsOne("ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "ItemOrdered", b1 =>
                {
                    b1.Property <int>("OrderItemId");

                    b1.Property <int>("CatalogItemId");

                    b1.Property <string>("PictureUri");

                    b1.Property <string>("ProductName");

                    b1.HasKey("OrderItemId");

                    b1.ToTable("OrderItems");

                    b1.HasOne("ApplicationCore.Entities.OrderAggregate.OrderItem")
                    .WithOne("ItemOrdered")
                    .HasForeignKey("ApplicationCore.Entities.OrderAggregate.CatalogItemOrdered", "OrderItemId")
                    .OnDelete(DeleteBehavior.Cascade);
                });
            });
#pragma warning restore 612, 618
        }
Beispiel #41
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
                .HasAnnotation("Relational:MaxIdentifierLength", 64);

            modelBuilder.Entity("WeddingPlanner.Models.Attendee", b =>
                {
                    b.Property<int>("AttendeeId")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("UserId");

                    b.Property<int>("WeddingId");

                    b.HasKey("AttendeeId");

                    b.HasIndex("UserId");

                    b.HasIndex("WeddingId");

                    b.ToTable("Attendees");
                });

            modelBuilder.Entity("WeddingPlanner.Models.User", b =>
                {
                    b.Property<int>("UserId")
                        .ValueGeneratedOnAdd();

                    b.Property<DateTime>("CreatedAt");

                    b.Property<string>("Email")
                        .IsRequired();

                    b.Property<string>("FirstName")
                        .IsRequired();

                    b.Property<string>("LastName")
                        .IsRequired();

                    b.Property<string>("Password")
                        .IsRequired();

                    b.Property<DateTime>("UpdatedAt");

                    b.HasKey("UserId");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("WeddingPlanner.Models.Wedding", b =>
                {
                    b.Property<int>("WeddingId")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("Address")
                        .IsRequired();

                    b.Property<DateTime>("CreatedAt");

                    b.Property<DateTime>("Date");

                    b.Property<DateTime>("UpdatedAt");

                    b.Property<int>("UserId");

                    b.Property<string>("WedderOne")
                        .IsRequired();

                    b.Property<string>("WedderTwo")
                        .IsRequired();

                    b.HasKey("WeddingId");

                    b.HasIndex("UserId");

                    b.ToTable("Weddings");
                });

            modelBuilder.Entity("WeddingPlanner.Models.Attendee", b =>
                {
                    b.HasOne("WeddingPlanner.Models.User", "User")
                        .WithMany("Attending")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("WeddingPlanner.Models.Wedding", "Wedding")
                        .WithMany("Atendees")
                        .HasForeignKey("WeddingId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("WeddingPlanner.Models.Wedding", b =>
                {
                    b.HasOne("WeddingPlanner.Models.User")
                        .WithMany("CreatedWeddings")
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("Relational:MaxIdentifierLength", 64)
            .HasAnnotation("ProductVersion", "5.0.3");

            modelBuilder.Entity("JustWorkForGodsSake.Models.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <string>("FirstName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("HomeTown")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("LastName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <int>("UserGroupId")
                .HasColumnType("int");

                b.HasKey("Id");

                b.ToTable("Users");

                b.HasData(
                    new
                {
                    Id          = 1,
                    FirstName   = "Jack",
                    HomeTown    = "Varna",
                    LastName    = "Smith",
                    UserGroupId = 1
                },
                    new
                {
                    Id          = 2,
                    FirstName   = "Simo",
                    HomeTown    = "Sofia",
                    LastName    = "Petrov",
                    UserGroupId = 1
                });
            });

            modelBuilder.Entity("JustWorkForGodsSake.Models.UserGroup", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <int>("Memebers")
                .HasColumnType("int");

                b.Property <string>("Name")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.HasKey("Id");

                b.ToTable("UserGroups");

                b.HasData(
                    new
                {
                    Id       = 1,
                    Memebers = 226,
                    Name     = "SoftServe"
                },
                    new
                {
                    Id       = 2,
                    Memebers = 150,
                    Name     = "IKEA"
                });
            });
#pragma warning restore 612, 618
        }
Beispiel #43
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("Relational:MaxIdentifierLength", 64)
                .HasAnnotation("ProductVersion", "5.0.2");

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Name")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4");

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasDatabaseName("RoleNameIndex");

                    b.ToTable("AspNetRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("RoleId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<int>("AccessFailedCount")
                        .HasColumnType("int");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken()
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("Email")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4");

                    b.Property<bool>("EmailConfirmed")
                        .HasColumnType("tinyint(1)");

                    b.Property<bool>("LockoutEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<DateTimeOffset?>("LockoutEnd")
                        .HasColumnType("datetime(6)");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4");

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4");

                    b.Property<string>("PasswordHash")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("PhoneNumber")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("PhoneNumberConfirmed")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("SecurityStamp")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<bool>("TwoFactorEnabled")
                        .HasColumnType("tinyint(1)");

                    b.Property<string>("UserName")
                        .HasMaxLength(256)
                        .HasColumnType("varchar(256) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasDatabaseName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasDatabaseName("UserNameIndex");

                    b.ToTable("AspNetUsers");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("int");

                    b.Property<string>("ClaimType")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("ClaimValue")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider")
                        .HasMaxLength(128)
                        .HasColumnType("varchar(128) CHARACTER SET utf8mb4");

                    b.Property<string>("ProviderKey")
                        .HasMaxLength(128)
                        .HasColumnType("varchar(128) CHARACTER SET utf8mb4");

                    b.Property<string>("ProviderDisplayName")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.Property<string>("UserId")
                        .IsRequired()
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("RoleId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId")
                        .HasColumnType("varchar(255) CHARACTER SET utf8mb4");

                    b.Property<string>("LoginProvider")
                        .HasMaxLength(128)
                        .HasColumnType("varchar(128) CHARACTER SET utf8mb4");

                    b.Property<string>("Name")
                        .HasMaxLength(128)
                        .HasColumnType("varchar(128) CHARACTER SET utf8mb4");

                    b.Property<string>("Value")
                        .HasColumnType("longtext CHARACTER SET utf8mb4");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole", null)
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser", null)
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.1.14-servicing-32113")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("MyVet.Web.Data.Entities.Agenda", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("Date");

                    b.Property<bool>("IsAvailable");

                    b.Property<int?>("OwnerId");

                    b.Property<int?>("PetId");

                    b.Property<string>("Remarks");

                    b.HasKey("Id");

                    b.HasIndex("OwnerId");

                    b.HasIndex("PetId");

                    b.ToTable("Agendas");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.History", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("Date");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasMaxLength(100);

                    b.Property<int?>("PetId");

                    b.Property<string>("Remarks");

                    b.Property<int?>("serviceTypeId");

                    b.HasKey("Id");

                    b.HasIndex("PetId");

                    b.HasIndex("serviceTypeId");

                    b.ToTable("Histories");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.Owner", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Address")
                        .HasMaxLength(100);

                    b.Property<string>("CellPhone")
                        .IsRequired()
                        .HasMaxLength(20);

                    b.Property<string>("Document")
                        .IsRequired()
                        .HasMaxLength(30);

                    b.Property<string>("FirstName")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<string>("FixedPhone")
                        .HasMaxLength(20);

                    b.Property<string>("LastName")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.HasKey("Id");

                    b.ToTable("Owners");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.Pet", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("Born");

                    b.Property<string>("ImageUrl");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<int?>("OwnerId");

                    b.Property<string>("Race")
                        .HasMaxLength(50);

                    b.Property<string>("Remarks");

                    b.Property<int?>("petTypeId");

                    b.HasKey("Id");

                    b.HasIndex("OwnerId");

                    b.HasIndex("petTypeId");

                    b.ToTable("Pets");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.PetType", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.HasKey("Id");

                    b.ToTable("petTypes");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.ServiceType", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.HasKey("Id");

                    b.ToTable("serviceTypes");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.Agenda", b =>
                {
                    b.HasOne("MyVet.Web.Data.Entities.Owner", "Owner")
                        .WithMany("Agendas")
                        .HasForeignKey("OwnerId");

                    b.HasOne("MyVet.Web.Data.Entities.Pet", "Pet")
                        .WithMany("Agendas")
                        .HasForeignKey("PetId");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.History", b =>
                {
                    b.HasOne("MyVet.Web.Data.Entities.Pet", "Pet")
                        .WithMany("Histories")
                        .HasForeignKey("PetId");

                    b.HasOne("MyVet.Web.Data.Entities.ServiceType", "serviceType")
                        .WithMany("Histories")
                        .HasForeignKey("serviceTypeId");
                });

            modelBuilder.Entity("MyVet.Web.Data.Entities.Pet", b =>
                {
                    b.HasOne("MyVet.Web.Data.Entities.Owner", "Owner")
                        .WithMany("Pets")
                        .HasForeignKey("OwnerId");

                    b.HasOne("MyVet.Web.Data.Entities.PetType", "petType")
                        .WithMany("Pets")
                        .HasForeignKey("petTypeId");
                });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "2.2.0-rtm-35687")
            .HasAnnotation("Relational:MaxIdentifierLength", 128)
            .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("SudokuApp.Data.Entity.Grid", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <Guid?>("CreatedBy");

                b.Property <DateTime>("CreatedDate");

                b.Property <Guid?>("DeletedBy");

                b.Property <DateTime?>("DeletedDate");

                b.Property <string>("FilledBoardData");

                b.Property <string>("FullBoardData")
                .IsRequired();

                b.Property <bool>("IsActive");

                b.Property <Guid?>("ModifiedBy");

                b.Property <DateTime?>("ModifiedDate");

                b.Property <int>("UserId");

                b.Property <byte[]>("Version")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate();

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("Grid");
            });

            modelBuilder.Entity("SudokuApp.Data.Entity.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd()
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <Guid?>("CreatedBy");

                b.Property <DateTime>("CreatedDate");

                b.Property <Guid?>("DeletedBy");

                b.Property <DateTime?>("DeletedDate");

                b.Property <Guid?>("ModifiedBy");

                b.Property <DateTime?>("ModifiedDate");

                b.Property <string>("UserName")
                .IsRequired();

                b.Property <byte[]>("Version")
                .IsConcurrencyToken()
                .ValueGeneratedOnAddOrUpdate();

                b.HasKey("Id");

                b.HasIndex("UserName")
                .IsUnique();

                b.ToTable("User");
            });

            modelBuilder.Entity("SudokuApp.Data.Entity.Grid", b =>
            {
                b.HasOne("SudokuApp.Data.Entity.User", "User")
                .WithMany("Grids")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });
#pragma warning restore 612, 618
        }
Beispiel #46
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "3.1.5")
            .HasAnnotation("Relational:MaxIdentifierLength", 128)
            .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("StockManagement.Data.Models.ProductModel", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <string>("ProductCode")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.HasKey("Id");

                b.HasIndex("ProductCode");

                b.ToTable("Product");
            });

            modelBuilder.Entity("StockManagement.Data.Models.StockActionModel", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <string>("CorrelationId")
                .IsRequired()
                .HasColumnType("nvarchar(450)");

                b.Property <int>("Count")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <long>("ProductId")
                .HasColumnType("bigint");

                b.Property <int>("StockActionType")
                .HasColumnType("int");

                b.HasKey("Id");

                b.HasIndex("ProductId");

                b.HasIndex("CorrelationId", "StockActionType")
                .IsUnique();

                b.ToTable("StockAction");
            });

            modelBuilder.Entity("StockManagement.Data.Models.StockModel", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <int>("AvailableStock")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <long>("ProductId")
                .HasColumnType("bigint");

                b.Property <string>("ProductCode")
                .IsRequired()
                .HasColumnType("nvarchar(max)");

                b.Property <long>("StockActionId")
                .HasColumnType("bigint");

                b.Property <DateTime>("UpdatedOn")
                .HasColumnType("datetime2");

                b.HasKey("Id");

                b.HasIndex("ProductId")
                .IsUnique();

                b.ToTable("Stock");
            });

            modelBuilder.Entity("StockManagement.Data.Models.StockSnapshotModel", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                b.Property <int>("AvailableStock")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedOn")
                .HasColumnType("datetime2");

                b.Property <long>("ProductId")
                .HasColumnType("bigint");

                b.Property <long>("StockActionId")
                .HasColumnType("bigint");

                b.Property <DateTime>("UpdatedOn")
                .HasColumnType("datetime2");

                b.HasKey("Id");

                b.HasIndex("ProductId");

                b.ToTable("StockSnapshot");
            });
#pragma warning restore 612, 618
        }
Beispiel #47
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.1.4-rtm-31024")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Name")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasName("RoleNameIndex")
                        .HasFilter("[NormalizedName] IS NOT NULL");

                    b.ToTable("AspNetRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("RoleId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUser", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("AccessFailedCount");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Discriminator")
                        .IsRequired();

                    b.Property<string>("Email")
                        .HasMaxLength(256);

                    b.Property<bool>("EmailConfirmed");

                    b.Property<bool>("LockoutEnabled");

                    b.Property<DateTimeOffset?>("LockoutEnd");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256);

                    b.Property<string>("PasswordHash");

                    b.Property<string>("PhoneNumber");

                    b.Property<bool>("PhoneNumberConfirmed");

                    b.Property<string>("SecurityStamp");

                    b.Property<bool>("TwoFactorEnabled");

                    b.Property<string>("UserName")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasName("UserNameIndex")
                        .HasFilter("[NormalizedUserName] IS NOT NULL");

                    b.ToTable("AspNetUsers");

                    b.HasDiscriminator<string>("Discriminator").HasValue("IdentityUser");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider");

                    b.Property<string>("ProviderKey");

                    b.Property<string>("ProviderDisplayName");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("RoleId");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("LoginProvider");

                    b.Property<string>("Name");

                    b.Property<string>("Value");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens");
                });

            modelBuilder.Entity("Smart_Binance.Models.API", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Guid");

                    b.Property<string>("Key");

                    b.Property<string>("Secret");

                    b.HasKey("Id");

                    b.ToTable("APIs");
                });

            modelBuilder.Entity("Smart_Binance.Models.Customer", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("APIId");

                    b.Property<string>("Name");

                    b.Property<int?>("PhoneNumber");

                    b.Property<string>("UserId");

                    b.HasKey("Id");

                    b.HasIndex("APIId");

                    b.HasIndex("UserId");

                    b.ToTable("Customers");
                });

            modelBuilder.Entity("Smart_Binance.Models.Trade", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(28, 18)");

                    b.Property<int>("AmountDecimal");

                    b.Property<int>("BasePriceDecimal");

                    b.Property<decimal>("BuyPrice")
                        .HasColumnType("decimal(28, 18)");

                    b.Property<int>("CustomerId");

                    b.Property<string>("DisplayType");

                    b.Property<bool>("IsTrailing");

                    b.Property<bool>("LimitPending");

                    b.Property<string>("Market");

                    b.Property<long>("OrderId");

                    b.Property<int>("PriceDecimal");

                    b.Property<DateTime>("StartTime");

                    b.Property<bool>("Status");

                    b.Property<decimal>("StopLossPrice")
                        .HasColumnType("decimal(28, 18)");

                    b.Property<bool>("Success");

                    b.Property<decimal>("TakeProfitPrice")
                        .HasColumnType("decimal(28, 18)");

                    b.Property<string>("Type");

                    b.HasKey("Id");

                    b.HasIndex("CustomerId");

                    b.ToTable("Trades");
                });

            modelBuilder.Entity("Smart_Binance.Models.TradeResult", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("EndTime");

                    b.Property<decimal>("PercentDiff")
                        .HasColumnType("decimal(10, 10)");

                    b.Property<long>("SellOrderId");

                    b.Property<decimal>("SellPrice")
                        .HasColumnType("decimal(10, 10)");

                    b.Property<bool>("Success");

                    b.Property<int>("TradeId");

                    b.HasKey("Id");

                    b.HasIndex("TradeId");

                    b.ToTable("TradeResults");
                });

            modelBuilder.Entity("Smart_Binance.Models.ApplicationUser", b =>
                {
                    b.HasBaseType("Microsoft.AspNetCore.Identity.IdentityUser");


                    b.ToTable("ApplicationUser");

                    b.HasDiscriminator().HasValue("ApplicationUser");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Smart_Binance.Models.Customer", b =>
                {
                    b.HasOne("Smart_Binance.Models.API", "API")
                        .WithMany()
                        .HasForeignKey("APIId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("Smart_Binance.Models.ApplicationUser", "ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId");
                });

            modelBuilder.Entity("Smart_Binance.Models.Trade", b =>
                {
                    b.HasOne("Smart_Binance.Models.Customer", "Customer")
                        .WithMany()
                        .HasForeignKey("CustomerId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("Smart_Binance.Models.TradeResult", b =>
                {
                    b.HasOne("Smart_Binance.Models.Trade", "Trade")
                        .WithMany()
                        .HasForeignKey("TradeId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.2.2-servicing-10034")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResource", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("Created");

                    b.Property<string>("Description")
                        .HasMaxLength(1000);

                    b.Property<string>("DisplayName")
                        .HasMaxLength(200);

                    b.Property<bool>("Enabled");

                    b.Property<DateTime?>("LastAccessed");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<bool>("NonEditable");

                    b.Property<DateTime?>("Updated");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("ApiResources");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ApiResourceId");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.HasKey("Id");

                    b.HasIndex("ApiResourceId");

                    b.ToTable("ApiClaims");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ApiResourceId");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(2000);

                    b.HasKey("Id");

                    b.HasIndex("ApiResourceId");

                    b.ToTable("ApiProperties");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ApiResourceId");

                    b.Property<string>("Description")
                        .HasMaxLength(1000);

                    b.Property<string>("DisplayName")
                        .HasMaxLength(200);

                    b.Property<bool>("Emphasize");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<bool>("Required");

                    b.Property<bool>("ShowInDiscoveryDocument");

                    b.HasKey("Id");

                    b.HasIndex("ApiResourceId");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("ApiScopes");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ApiScopeId");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.HasKey("Id");

                    b.HasIndex("ApiScopeId");

                    b.ToTable("ApiScopeClaims");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ApiResourceId");

                    b.Property<DateTime>("Created");

                    b.Property<string>("Description")
                        .HasMaxLength(1000);

                    b.Property<DateTime?>("Expiration");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(4000);

                    b.HasKey("Id");

                    b.HasIndex("ApiResourceId");

                    b.ToTable("ApiSecrets");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.Client", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("AbsoluteRefreshTokenLifetime");

                    b.Property<int>("AccessTokenLifetime");

                    b.Property<int>("AccessTokenType");

                    b.Property<bool>("AllowAccessTokensViaBrowser");

                    b.Property<bool>("AllowOfflineAccess");

                    b.Property<bool>("AllowPlainTextPkce");

                    b.Property<bool>("AllowRememberConsent");

                    b.Property<bool>("AlwaysIncludeUserClaimsInIdToken");

                    b.Property<bool>("AlwaysSendClientClaims");

                    b.Property<int>("AuthorizationCodeLifetime");

                    b.Property<bool>("BackChannelLogoutSessionRequired");

                    b.Property<string>("BackChannelLogoutUri")
                        .HasMaxLength(2000);

                    b.Property<string>("ClientClaimsPrefix")
                        .HasMaxLength(200);

                    b.Property<string>("ClientId")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<string>("ClientName")
                        .HasMaxLength(200);

                    b.Property<string>("ClientUri")
                        .HasMaxLength(2000);

                    b.Property<int?>("ConsentLifetime");

                    b.Property<DateTime>("Created");

                    b.Property<string>("Description")
                        .HasMaxLength(1000);

                    b.Property<int>("DeviceCodeLifetime");

                    b.Property<bool>("EnableLocalLogin");

                    b.Property<bool>("Enabled");

                    b.Property<bool>("FrontChannelLogoutSessionRequired");

                    b.Property<string>("FrontChannelLogoutUri")
                        .HasMaxLength(2000);

                    b.Property<int>("IdentityTokenLifetime");

                    b.Property<bool>("IncludeJwtId");

                    b.Property<DateTime?>("LastAccessed");

                    b.Property<string>("LogoUri")
                        .HasMaxLength(2000);

                    b.Property<bool>("NonEditable");

                    b.Property<string>("PairWiseSubjectSalt")
                        .HasMaxLength(200);

                    b.Property<string>("ProtocolType")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<int>("RefreshTokenExpiration");

                    b.Property<int>("RefreshTokenUsage");

                    b.Property<bool>("RequireClientSecret");

                    b.Property<bool>("RequireConsent");

                    b.Property<bool>("RequirePkce");

                    b.Property<int>("SlidingRefreshTokenLifetime");

                    b.Property<bool>("UpdateAccessTokenClaimsOnRefresh");

                    b.Property<DateTime?>("Updated");

                    b.Property<string>("UserCodeType")
                        .HasMaxLength(100);

                    b.Property<int?>("UserSsoLifetime");

                    b.HasKey("Id");

                    b.HasIndex("ClientId")
                        .IsUnique();

                    b.ToTable("Clients");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientClaims");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("Origin")
                        .IsRequired()
                        .HasMaxLength(150);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientCorsOrigins");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("GrantType")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientGrantTypes");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("Provider")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientIdPRestrictions");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("PostLogoutRedirectUri")
                        .IsRequired()
                        .HasMaxLength(2000);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientPostLogoutRedirectUris");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(2000);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientProperties");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("RedirectUri")
                        .IsRequired()
                        .HasMaxLength(2000);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientRedirectUris");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<string>("Scope")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientScopes");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("ClientId");

                    b.Property<DateTime>("Created");

                    b.Property<string>("Description")
                        .HasMaxLength(2000);

                    b.Property<DateTime?>("Expiration");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(4000);

                    b.HasKey("Id");

                    b.HasIndex("ClientId");

                    b.ToTable("ClientSecrets");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.DeviceFlowCodes", b =>
                {
                    b.Property<string>("UserCode")
                        .ValueGeneratedOnAdd()
                        .HasMaxLength(200);

                    b.Property<string>("ClientId")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<DateTime>("CreationTime");

                    b.Property<string>("Data")
                        .IsRequired()
                        .HasMaxLength(50000);

                    b.Property<string>("DeviceCode")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<DateTime?>("Expiration")
                        .IsRequired();

                    b.Property<string>("SubjectId")
                        .HasMaxLength(200);

                    b.HasKey("UserCode");

                    b.HasIndex("DeviceCode")
                        .IsUnique();

                    b.ToTable("DeviceCodes");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("IdentityResourceId");

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.HasKey("Id");

                    b.HasIndex("IdentityResourceId");

                    b.ToTable("IdentityClaims");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResource", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("Created");

                    b.Property<string>("Description")
                        .HasMaxLength(1000);

                    b.Property<string>("DisplayName")
                        .HasMaxLength(200);

                    b.Property<bool>("Emphasize");

                    b.Property<bool>("Enabled");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<bool>("NonEditable");

                    b.Property<bool>("Required");

                    b.Property<bool>("ShowInDiscoveryDocument");

                    b.Property<DateTime?>("Updated");

                    b.HasKey("Id");

                    b.HasIndex("Name")
                        .IsUnique();

                    b.ToTable("IdentityResources");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("IdentityResourceId");

                    b.Property<string>("Key")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<string>("Value")
                        .IsRequired()
                        .HasMaxLength(2000);

                    b.HasKey("Id");

                    b.HasIndex("IdentityResourceId");

                    b.ToTable("IdentityProperties");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.PersistedGrant", b =>
                {
                    b.Property<string>("Key")
                        .HasMaxLength(200);

                    b.Property<string>("ClientId")
                        .IsRequired()
                        .HasMaxLength(200);

                    b.Property<DateTime>("CreationTime");

                    b.Property<string>("Data")
                        .IsRequired()
                        .HasMaxLength(50000);

                    b.Property<DateTime?>("Expiration");

                    b.Property<string>("SubjectId")
                        .HasMaxLength(200);

                    b.Property<string>("Type")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.HasKey("Key");

                    b.HasIndex("SubjectId", "ClientId", "Type");

                    b.ToTable("PersistedGrants");
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceClaim", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                        .WithMany("UserClaims")
                        .HasForeignKey("ApiResourceId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiResourceProperty", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                        .WithMany("Properties")
                        .HasForeignKey("ApiResourceId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScope", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                        .WithMany("Scopes")
                        .HasForeignKey("ApiResourceId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiScopeClaim", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.ApiScope", "ApiScope")
                        .WithMany("UserClaims")
                        .HasForeignKey("ApiScopeId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ApiSecret", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.ApiResource", "ApiResource")
                        .WithMany("Secrets")
                        .HasForeignKey("ApiResourceId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientClaim", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("Claims")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientCorsOrigin", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("AllowedCorsOrigins")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientGrantType", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("AllowedGrantTypes")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientIdPRestriction", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("IdentityProviderRestrictions")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientPostLogoutRedirectUri", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("PostLogoutRedirectUris")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientProperty", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("Properties")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientRedirectUri", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("RedirectUris")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientScope", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("AllowedScopes")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.ClientSecret", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.Client", "Client")
                        .WithMany("ClientSecrets")
                        .HasForeignKey("ClientId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityClaim", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource")
                        .WithMany("UserClaims")
                        .HasForeignKey("IdentityResourceId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("IdentityServer4.EntityFramework.Entities.IdentityResourceProperty", b =>
                {
                    b.HasOne("IdentityServer4.EntityFramework.Entities.IdentityResource", "IdentityResource")
                        .WithMany("Properties")
                        .HasForeignKey("IdentityResourceId")
                        .OnDelete(DeleteBehavior.Cascade);
                });
#pragma warning restore 612, 618
        }
Beispiel #49
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "2.2.6-servicing-10079");

            modelBuilder.Entity("DatingApp.API.Models.Photo", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <DateTime>("DateAdded");

                b.Property <string>("Description");

                b.Property <bool>("IsMain");

                b.Property <string>("PublicId");

                b.Property <string>("Url");

                b.Property <int>("UserId");

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("Photos");
            });

            modelBuilder.Entity("DatingApp.API.Models.User", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("City");

                b.Property <string>("Country");

                b.Property <DateTime>("Created");

                b.Property <DateTime>("DateOfBirth");

                b.Property <string>("Gender");

                b.Property <string>("Interests");

                b.Property <string>("Introduction");

                b.Property <string>("KnownAs");

                b.Property <DateTime>("LastActive");

                b.Property <string>("LookingFor");

                b.Property <byte[]>("PasswordHash");

                b.Property <byte[]>("PasswordSalt");

                b.Property <string>("Username");

                b.HasKey("Id");

                b.ToTable("Users");
            });

            modelBuilder.Entity("DatingApp.API.Models.Value", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Name");

                b.HasKey("Id");

                b.ToTable("Values");
            });

            modelBuilder.Entity("DatingApp.API.Models.Photo", b =>
            {
                b.HasOne("DatingApp.API.Models.User", "User")
                .WithMany("Photos")
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });
#pragma warning restore 612, 618
        }
Beispiel #50
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("ProductVersion", "2.0.3-rtm-10026")
            .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("ISCS.Data.Entities.Area", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Coords");

                b.Property <string>("Name");

                b.HasKey("Id");

                b.ToTable("Areas");
            });

            modelBuilder.Entity("ISCS.Data.Entities.AreaWork", b =>
            {
                b.Property <long>("WorkId");

                b.Property <long>("AreaId");

                b.HasKey("WorkId", "AreaId");

                b.HasIndex("AreaId");

                b.ToTable("AreaWorks");
            });

            modelBuilder.Entity("ISCS.Data.Entities.Equipment", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("AreaId");

                b.Property <string>("Description");

                b.Property <string>("Name");

                b.HasKey("Id");

                b.HasIndex("AreaId");

                b.ToTable("Equipments");
            });

            modelBuilder.Entity("ISCS.Data.Entities.EquipmentOperation", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <long>("EquipmentId");

                b.Property <long>("OperationId");

                b.HasKey("Id");

                b.HasIndex("EquipmentId");

                b.HasIndex("OperationId");

                b.ToTable("EquipmentOperations");
            });

            modelBuilder.Entity("ISCS.Data.Entities.Operation", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Description");

                b.Property <string>("Name");

                b.HasKey("Id");

                b.ToTable("Operations");
            });

            modelBuilder.Entity("ISCS.Data.Entities.TechCard", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Comment");

                b.Property <DateTime>("CreationDate")
                .ValueGeneratedOnAdd()
                .HasDefaultValue(new DateTime(2018, 5, 15, 0, 0, 0, 0, DateTimeKind.Local));

                b.Property <string>("Description");

                b.Property <bool>("IsActual")
                .ValueGeneratedOnAdd()
                .HasDefaultValue(true);

                b.Property <int>("PeopleNumber");

                b.Property <int>("TechCardState")
                .ValueGeneratedOnAdd()
                .HasDefaultValue(0);

                b.Property <long>("WorkId");

                b.HasKey("Id");

                b.HasIndex("WorkId");

                b.ToTable("TechCards");
            });

            modelBuilder.Entity("ISCS.Data.Entities.TechCardEquipment", b =>
            {
                b.Property <long>("EquipmentId");

                b.Property <long>("TechCardId");

                b.HasKey("EquipmentId", "TechCardId");

                b.HasIndex("TechCardId");

                b.ToTable("TechCardEquipments");
            });

            modelBuilder.Entity("ISCS.Data.Entities.TechCardOperation", b =>
            {
                b.Property <long>("TechCardId");

                b.Property <long>("EquipmentOperationId");

                b.Property <long>("OrderId");

                b.HasKey("TechCardId", "EquipmentOperationId");

                b.HasIndex("EquipmentOperationId");

                b.ToTable("TechCardOperations");
            });

            modelBuilder.Entity("ISCS.Data.Entities.Work", b =>
            {
                b.Property <long>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("Description");

                b.Property <string>("Name");

                b.HasKey("Id");

                b.ToTable("Works");
            });

            modelBuilder.Entity("ISCS.Models.ApplicationUser", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd();

                b.Property <int>("AccessFailedCount");

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken();

                b.Property <string>("Email")
                .HasMaxLength(256);

                b.Property <bool>("EmailConfirmed");

                b.Property <bool>("LockoutEnabled");

                b.Property <DateTimeOffset?>("LockoutEnd");

                b.Property <string>("NormalizedEmail")
                .HasMaxLength(256);

                b.Property <string>("NormalizedUserName")
                .HasMaxLength(256);

                b.Property <string>("PasswordHash");

                b.Property <string>("PhoneNumber");

                b.Property <bool>("PhoneNumberConfirmed");

                b.Property <string>("SecurityStamp");

                b.Property <bool>("TwoFactorEnabled");

                b.Property <string>("UserName")
                .HasMaxLength(256);

                b.HasKey("Id");

                b.HasIndex("NormalizedEmail")
                .HasName("EmailIndex");

                b.HasIndex("NormalizedUserName")
                .IsUnique()
                .HasName("UserNameIndex")
                .HasFilter("[NormalizedUserName] IS NOT NULL");

                b.ToTable("AspNetUsers");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
            {
                b.Property <string>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("ConcurrencyStamp")
                .IsConcurrencyToken();

                b.Property <string>("Name")
                .HasMaxLength(256);

                b.Property <string>("NormalizedName")
                .HasMaxLength(256);

                b.HasKey("Id");

                b.HasIndex("NormalizedName")
                .IsUnique()
                .HasName("RoleNameIndex")
                .HasFilter("[NormalizedName] IS NOT NULL");

                b.ToTable("AspNetRoles");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("ClaimType");

                b.Property <string>("ClaimValue");

                b.Property <string>("RoleId")
                .IsRequired();

                b.HasKey("Id");

                b.HasIndex("RoleId");

                b.ToTable("AspNetRoleClaims");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.Property <int>("Id")
                .ValueGeneratedOnAdd();

                b.Property <string>("ClaimType");

                b.Property <string>("ClaimValue");

                b.Property <string>("UserId")
                .IsRequired();

                b.HasKey("Id");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserClaims");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.Property <string>("LoginProvider");

                b.Property <string>("ProviderKey");

                b.Property <string>("ProviderDisplayName");

                b.Property <string>("UserId")
                .IsRequired();

                b.HasKey("LoginProvider", "ProviderKey");

                b.HasIndex("UserId");

                b.ToTable("AspNetUserLogins");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.Property <string>("UserId");

                b.Property <string>("RoleId");

                b.HasKey("UserId", "RoleId");

                b.HasIndex("RoleId");

                b.ToTable("AspNetUserRoles");
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.Property <string>("UserId");

                b.Property <string>("LoginProvider");

                b.Property <string>("Name");

                b.Property <string>("Value");

                b.HasKey("UserId", "LoginProvider", "Name");

                b.ToTable("AspNetUserTokens");
            });

            modelBuilder.Entity("ISCS.Data.Entities.AreaWork", b =>
            {
                b.HasOne("ISCS.Data.Entities.Area", "Area")
                .WithMany("AreaWorks")
                .HasForeignKey("AreaId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("ISCS.Data.Entities.Work", "Work")
                .WithMany("AreaWorks")
                .HasForeignKey("WorkId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ISCS.Data.Entities.Equipment", b =>
            {
                b.HasOne("ISCS.Data.Entities.Area", "Area")
                .WithMany("Equipments")
                .HasForeignKey("AreaId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ISCS.Data.Entities.EquipmentOperation", b =>
            {
                b.HasOne("ISCS.Data.Entities.Equipment", "Equipment")
                .WithMany("EquipmentOperations")
                .HasForeignKey("EquipmentId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("ISCS.Data.Entities.Operation", "Operation")
                .WithMany("EquipmentOperations")
                .HasForeignKey("OperationId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ISCS.Data.Entities.TechCard", b =>
            {
                b.HasOne("ISCS.Data.Entities.Work", "Work")
                .WithMany("TechCards")
                .HasForeignKey("WorkId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ISCS.Data.Entities.TechCardEquipment", b =>
            {
                b.HasOne("ISCS.Data.Entities.Equipment", "Equipment")
                .WithMany("TechCardEquipments")
                .HasForeignKey("EquipmentId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("ISCS.Data.Entities.TechCard", "TechCard")
                .WithMany("TechCardEquipments")
                .HasForeignKey("TechCardId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("ISCS.Data.Entities.TechCardOperation", b =>
            {
                b.HasOne("ISCS.Data.Entities.EquipmentOperation", "EquipmentOperation")
                .WithMany()
                .HasForeignKey("EquipmentOperationId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("ISCS.Data.Entities.TechCard", "TechCard")
                .WithMany("TechCardOperations")
                .HasForeignKey("TechCardId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
            {
                b.HasOne("ISCS.Models.ApplicationUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
            {
                b.HasOne("ISCS.Models.ApplicationUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
            {
                b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                .WithMany()
                .HasForeignKey("RoleId")
                .OnDelete(DeleteBehavior.Cascade);

                b.HasOne("ISCS.Models.ApplicationUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
            {
                b.HasOne("ISCS.Models.ApplicationUser")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade);
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("BachelorProject.Models.AdditionalGame", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ApplicationUserId");

                    b.Property<int?>("BarmaidId");

                    b.Property<int>("BranchOffice");

                    b.Property<int>("Count");

                    b.Property<DateTime>("Date");

                    b.Property<int>("GameTypeId");

                    b.Property<int?>("InstructorId");

                    b.HasKey("Id");

                    b.HasIndex("ApplicationUserId");

                    b.HasIndex("BarmaidId");

                    b.HasIndex("GameTypeId");

                    b.HasIndex("InstructorId");

                    b.ToTable("AdditionalGames");
                });

            modelBuilder.Entity("BachelorProject.Models.ApplicationUser", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<int>("AccessFailedCount");

                    b.Property<int?>("BranchOffice");

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Email")
                        .HasMaxLength(256);

                    b.Property<bool>("EmailConfirmed");

                    b.Property<bool>("LockoutEnabled");

                    b.Property<DateTimeOffset?>("LockoutEnd");

                    b.Property<string>("NormalizedEmail")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedUserName")
                        .HasMaxLength(256);

                    b.Property<string>("PasswordHash");

                    b.Property<string>("PhoneNumber");

                    b.Property<bool>("PhoneNumberConfirmed");

                    b.Property<string>("SecurityStamp");

                    b.Property<bool>("TwoFactorEnabled");

                    b.Property<string>("UserName")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedEmail")
                        .HasName("EmailIndex");

                    b.HasIndex("NormalizedUserName")
                        .IsUnique()
                        .HasName("UserNameIndex")
                        .HasFilter("[NormalizedUserName] IS NOT NULL");

                    b.ToTable("AspNetUsers");
                });

            modelBuilder.Entity("BachelorProject.Models.Employee", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Email")
                        .IsRequired();

                    b.Property<bool>("IsValid");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<int>("Role");

                    b.HasKey("Id");

                    b.ToTable("Employees");
                });

            modelBuilder.Entity("BachelorProject.Models.GameType", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<int>("BarmaidCommision");

                    b.Property<int>("InstruktorCommision");

                    b.Property<bool>("IsValid");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<int>("Price");

                    b.Property<int>("SoloCommision");

                    b.HasKey("Id");

                    b.ToTable("GameTypes");
                });

            modelBuilder.Entity("BachelorProject.Models.Voucher", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ApplicationUserId");

                    b.Property<string>("Code");

                    b.Property<DateTime>("CreationDate");

                    b.Property<string>("Description")
                        .IsRequired()
                        .HasMaxLength(250);

                    b.Property<bool>("IsValid");

                    b.Property<string>("Title")
                        .IsRequired()
                        .HasMaxLength(50);

                    b.Property<DateTime>("ValidFrom");

                    b.Property<DateTime>("ValidUntil");

                    b.Property<int>("Value");

                    b.HasKey("Id");

                    b.HasIndex("ApplicationUserId");

                    b.ToTable("Vouchers");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRole", b =>
                {
                    b.Property<string>("Id")
                        .ValueGeneratedOnAdd();

                    b.Property<string>("ConcurrencyStamp")
                        .IsConcurrencyToken();

                    b.Property<string>("Name")
                        .HasMaxLength(256);

                    b.Property<string>("NormalizedName")
                        .HasMaxLength(256);

                    b.HasKey("Id");

                    b.HasIndex("NormalizedName")
                        .IsUnique()
                        .HasName("RoleNameIndex")
                        .HasFilter("[NormalizedName] IS NOT NULL");

                    b.ToTable("AspNetRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("RoleId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetRoleClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.Property<int>("Id")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("ClaimType");

                    b.Property<string>("ClaimValue");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("Id");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserClaims");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.Property<string>("LoginProvider");

                    b.Property<string>("ProviderKey");

                    b.Property<string>("ProviderDisplayName");

                    b.Property<string>("UserId")
                        .IsRequired();

                    b.HasKey("LoginProvider", "ProviderKey");

                    b.HasIndex("UserId");

                    b.ToTable("AspNetUserLogins");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("RoleId");

                    b.HasKey("UserId", "RoleId");

                    b.HasIndex("RoleId");

                    b.ToTable("AspNetUserRoles");
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.Property<string>("UserId");

                    b.Property<string>("LoginProvider");

                    b.Property<string>("Name");

                    b.Property<string>("Value");

                    b.HasKey("UserId", "LoginProvider", "Name");

                    b.ToTable("AspNetUserTokens");
                });

            modelBuilder.Entity("BachelorProject.Models.AdditionalGame", b =>
                {
                    b.HasOne("BachelorProject.Models.ApplicationUser", "ApplicationUser")
                        .WithMany()
                        .HasForeignKey("ApplicationUserId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("BachelorProject.Models.Employee", "Barmaid")
                        .WithMany("BarmaidAdditionalGames")
                        .HasForeignKey("BarmaidId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("BachelorProject.Models.GameType", "GameType")
                        .WithMany("AdditionalGames")
                        .HasForeignKey("GameTypeId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("BachelorProject.Models.Employee", "Instructor")
                        .WithMany("InstuctorAdditionalGames")
                        .HasForeignKey("InstructorId")
                        .OnDelete(DeleteBehavior.Restrict);
                });

            modelBuilder.Entity("BachelorProject.Models.Voucher", b =>
                {
                    b.HasOne("BachelorProject.Models.ApplicationUser", "ApplicationUser")
                        .WithMany()
                        .HasForeignKey("ApplicationUserId")
                        .OnDelete(DeleteBehavior.Restrict);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityRoleClaim<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Restrict);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserClaim<string>", b =>
                {
                    b.HasOne("BachelorProject.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserLogin<string>", b =>
                {
                    b.HasOne("BachelorProject.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserRole<string>", b =>
                {
                    b.HasOne("Microsoft.AspNetCore.Identity.IdentityRole")
                        .WithMany()
                        .HasForeignKey("RoleId")
                        .OnDelete(DeleteBehavior.Restrict);

                    b.HasOne("BachelorProject.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict);
                });

            modelBuilder.Entity("Microsoft.AspNetCore.Identity.IdentityUserToken<string>", b =>
                {
                    b.HasOne("BachelorProject.Models.ApplicationUser")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Restrict);
                });
#pragma warning restore 612, 618
        }
        public override void ApplyConfiguration(ModelBuilder modelBuilder)
        {
            base.ApplyConfiguration(modelBuilder);


        }
Beispiel #53
0
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.HasAnnotation("ProductVersion", "2.2.4-servicing-10062");

            modelBuilder.Entity<Locations>(entity =>
            {
                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.City)
                    .IsRequired()
                    .HasColumnName("city")
                    .HasMaxLength(50);

                entity.Property(e => e.Country)
                    .IsRequired()
                    .HasColumnName("country")
                    .HasMaxLength(50);

                entity.Property(e => e.Image)
                    .HasColumnName("image")
                    .HasMaxLength(50);

                entity.Property(e => e.Latitude).HasColumnName("latitude");

                entity.Property(e => e.Longitude).HasColumnName("longitude");

                entity.Property(e => e.Tripadvisor)
                    .HasColumnName("tripadvisor")
                    .HasMaxLength(50);
            });

            modelBuilder.Entity<Users>(entity =>
            {
                entity.HasKey(e => e.Userid)
                    .HasName("PK_Users_1");

                entity.Property(e => e.Userid).HasColumnName("userid");

                entity.Property(e => e.Firstname)
                    .IsRequired()
                    .HasColumnName("firstname")
                    .HasMaxLength(50);

                entity.Property(e => e.Joindate)
                    .HasColumnName("joindate")
                    .HasColumnType("datetime");

                entity.Property(e => e.Lastname)
                    .IsRequired()
                    .HasColumnName("lastname")
                    .HasMaxLength(50);

                entity.Property(e => e.Password)
                    .IsRequired()
                    .HasColumnName("password")
                    .HasMaxLength(50);

                entity.Property(e => e.Username)
                    .IsRequired()
                    .HasColumnName("username")
                    .HasMaxLength(50);
            });

            modelBuilder.Entity<Vacation>(entity =>
            {
                entity.Property(e => e.Id).HasColumnName("id");

                entity.Property(e => e.Isactive).HasColumnName("isactive");

                entity.Property(e => e.Location)
                    .IsRequired()
                    .HasColumnName("location")
                    .HasMaxLength(50);

                entity.Property(e => e.Startdate)
                    .HasColumnName("startdate")
                    .HasColumnType("date");

                entity.Property(e => e.User)
                    .IsRequired()
                    .HasColumnName("user")
                    .HasMaxLength(50);
            });
        }
Beispiel #54
0
 protected override void OnModelCreating(ModelBuilder modelBuilder)
 {
     modelBuilder.Entity <Equipo>().ToTable("Equipo");
     modelBuilder.Entity <Jugador>().ToTable("Jugador");
 }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "3.1.1")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("IRunes.Models.Album", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Cover")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(20)")
                        .HasMaxLength(20);

                    b.Property<decimal>("Price")
                        .HasColumnType("decimal(18,2)");

                    b.HasKey("Id");

                    b.ToTable("Albums");
                });

            modelBuilder.Entity("IRunes.Models.Track", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("AlbumId")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Link")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(20)")
                        .HasMaxLength(20);

                    b.Property<decimal>("Price")
                        .HasColumnType("decimal(18,2)");

                    b.HasKey("Id");

                    b.HasIndex("AlbumId");

                    b.ToTable("Tracks");
                });

            modelBuilder.Entity("IRunes.Models.User", b =>
                {
                    b.Property<string>("Id")
                        .HasColumnType("nvarchar(450)");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<int>("Role")
                        .HasColumnType("int");

                    b.Property<string>("Username")
                        .IsRequired()
                        .HasColumnType("nvarchar(20)")
                        .HasMaxLength(20);

                    b.HasKey("Id");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("IRunes.Models.Track", b =>
                {
                    b.HasOne("IRunes.Models.Album", "Album")
                        .WithMany("Tracks")
                        .HasForeignKey("AlbumId");
                });
#pragma warning restore 612, 618
        }
        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            modelBuilder.Entity<Address>(entity =>
            {
                entity.HasKey(e => e.AddressId);

                entity.Property(e => e.AddressId).HasColumnName("AddressID");

                entity.Property(e => e.AddressText)
                    .IsRequired()
                    .HasMaxLength(100)
                    .IsUnicode(false);

                entity.Property(e => e.TownId).HasColumnName("TownID");

                entity.HasOne(d => d.Town)
                    .WithMany(p => p.Addresses)
                    .HasForeignKey(d => d.TownId)
                    .HasConstraintName("FK_Addresses_Towns");
            });

            modelBuilder.Entity<Department>(entity =>
            {
                entity.HasKey(e => e.DepartmentId);

                entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID");

                entity.Property(e => e.ManagerId).HasColumnName("ManagerID");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.HasOne(d => d.Manager)
                    .WithMany(p => p.Departments)
                    .HasForeignKey(d => d.ManagerId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("FK_Departments_Employees");
            });

            modelBuilder.Entity<Employee>(entity =>
            {
                entity.HasKey(e => e.EmployeeId);

                entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID");

                entity.Property(e => e.AddressId).HasColumnName("AddressID");

                entity.Property(e => e.DepartmentId).HasColumnName("DepartmentID");

                entity.Property(e => e.FirstName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.HireDate).HasColumnType("smalldatetime");

                entity.Property(e => e.JobTitle)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.LastName)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.ManagerId).HasColumnName("ManagerID");

                entity.Property(e => e.MiddleName)
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.Salary).HasColumnType("decimal(15, 4)");

                entity.HasOne(d => d.Address)
                    .WithMany(p => p.Employees)
                    .HasForeignKey(d => d.AddressId)
                    .HasConstraintName("FK_Employees_Addresses");

                entity.HasOne(d => d.Department)
                    .WithMany(p => p.Employees)
                    .HasForeignKey(d => d.DepartmentId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("FK_Employees_Departments");

                entity.HasOne(d => d.Manager)
                    .WithMany(p => p.InverseManager)
                    .HasForeignKey(d => d.ManagerId)
                    .HasConstraintName("FK_Employees_Employees");
            });

            modelBuilder.Entity<EmployeeProject>(entity =>
            {
                entity.HasKey(e => new { e.EmployeeId, e.ProjectId });

                entity.Property(e => e.EmployeeId).HasColumnName("EmployeeID");

                entity.Property(e => e.ProjectId).HasColumnName("ProjectID");

                entity.HasOne(d => d.Employee)
                    .WithMany(p => p.EmployeesProjects)
                    .HasForeignKey(d => d.EmployeeId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("FK_EmployeesProjects_Employees");

                entity.HasOne(d => d.Project)
                    .WithMany(p => p.EmployeesProjects)
                    .HasForeignKey(d => d.ProjectId)
                    .OnDelete(DeleteBehavior.ClientSetNull)
                    .HasConstraintName("FK_EmployeesProjects_Projects");
            });

            modelBuilder.Entity<Project>(entity =>
            {
                entity.HasKey(e => e.ProjectId);

                entity.Property(e => e.ProjectId).HasColumnName("ProjectID");

                entity.Property(e => e.Description).HasColumnType("ntext");

                entity.Property(e => e.EndDate).HasColumnType("smalldatetime");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);

                entity.Property(e => e.StartDate).HasColumnType("smalldatetime");
            });

            modelBuilder.Entity<Town>(entity =>
            {
                entity.HasKey(e => e.TownId);

                entity.Property(e => e.TownId).HasColumnName("TownID");

                entity.Property(e => e.Name)
                    .IsRequired()
                    .HasMaxLength(50)
                    .IsUnicode(false);
            });

            OnModelCreatingPartial(modelBuilder);
        }
Beispiel #57
0
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .UseIdentityColumns()
            .HasAnnotation("Relational:MaxIdentifierLength", 128)
            .HasAnnotation("ProductVersion", "5.0.1");

            modelBuilder.Entity("PizzaWorld.Domain.Abstracts.APizzaModel", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <long?>("CrustEntityId")
                .HasColumnType("bigint");

                b.Property <long?>("OrderEntityId")
                .HasColumnType("bigint");

                b.Property <long?>("SizeEntityId")
                .HasColumnType("bigint");

                b.HasKey("EntityId");

                b.HasIndex("CrustEntityId");

                b.HasIndex("OrderEntityId");

                b.HasIndex("SizeEntityId");

                b.ToTable("APizzaModel");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Crust", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("EntityId");

                b.ToTable("Crusts");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Order", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <long?>("StoreEntityId")
                .HasColumnType("bigint");

                b.Property <long?>("UserEntityId")
                .HasColumnType("bigint");

                b.HasKey("EntityId");

                b.HasIndex("StoreEntityId");

                b.HasIndex("UserEntityId");

                b.ToTable("Order");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Size", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <int>("Inches")
                .HasColumnType("int");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("EntityId");

                b.ToTable("Sizes");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Store", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("EntityId");

                b.ToTable("Stores");

                b.HasData(
                    new
                {
                    EntityId = 1L,
                    Name     = "First Store"
                },
                    new
                {
                    EntityId = 2L,
                    Name     = "Second Store"
                });
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Topping", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <long?>("APizzaModelEntityId")
                .HasColumnType("bigint");

                b.Property <string>("Name")
                .HasColumnType("nvarchar(max)");

                b.HasKey("EntityId");

                b.HasIndex("APizzaModelEntityId");

                b.ToTable("Toppings");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.User", b =>
            {
                b.Property <long>("EntityId")
                .ValueGeneratedOnAdd()
                .HasColumnType("bigint")
                .UseIdentityColumn();

                b.Property <long?>("SelectedStoreEntityId")
                .HasColumnType("bigint");

                b.HasKey("EntityId");

                b.HasIndex("SelectedStoreEntityId");

                b.ToTable("Users");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Abstracts.APizzaModel", b =>
            {
                b.HasOne("PizzaWorld.Domain.Models.Crust", "Crust")
                .WithMany()
                .HasForeignKey("CrustEntityId");

                b.HasOne("PizzaWorld.Domain.Models.Order", null)
                .WithMany("Pizzas")
                .HasForeignKey("OrderEntityId");

                b.HasOne("PizzaWorld.Domain.Models.Size", "Size")
                .WithMany()
                .HasForeignKey("SizeEntityId");

                b.Navigation("Crust");

                b.Navigation("Size");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Order", b =>
            {
                b.HasOne("PizzaWorld.Domain.Models.Store", null)
                .WithMany("Orders")
                .HasForeignKey("StoreEntityId");

                b.HasOne("PizzaWorld.Domain.Models.User", null)
                .WithMany("Orders")
                .HasForeignKey("UserEntityId");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Topping", b =>
            {
                b.HasOne("PizzaWorld.Domain.Abstracts.APizzaModel", null)
                .WithMany("Toppings")
                .HasForeignKey("APizzaModelEntityId");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.User", b =>
            {
                b.HasOne("PizzaWorld.Domain.Models.Store", "SelectedStore")
                .WithMany()
                .HasForeignKey("SelectedStoreEntityId");

                b.Navigation("SelectedStore");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Abstracts.APizzaModel", b =>
            {
                b.Navigation("Toppings");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Order", b =>
            {
                b.Navigation("Pizzas");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.Store", b =>
            {
                b.Navigation("Orders");
            });

            modelBuilder.Entity("PizzaWorld.Domain.Models.User", b =>
            {
                b.Navigation("Orders");
            });
#pragma warning restore 612, 618
        }
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
            .HasAnnotation("Relational:MaxIdentifierLength", 64)
            .HasAnnotation("ProductVersion", "5.0.4");

            modelBuilder.Entity("PragyoSala.Services.Models.Category", b =>
            {
                b.Property <int>("CategoryId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("DeletedAt")
                .HasColumnType("datetime(6)");

                b.Property <bool>("DisplayHome")
                .HasColumnType("tinyint(1)");

                b.Property <string>("Link")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("Name")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.HasKey("CategoryId");

                b.ToTable("categories");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Chapter", b =>
            {
                b.Property <int>("ChapterId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <string>("ChapterName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <int>("CourseId")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("DeletedAt")
                .HasColumnType("datetime(6)");

                b.Property <int>("Order")
                .HasColumnType("int");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.HasKey("ChapterId");

                b.HasIndex("CourseId");

                b.ToTable("chapters");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Comment", b =>
            {
                b.Property <int>("CommentId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <int>("ChapterId")
                .HasColumnType("int");

                b.Property <int>("CourseId")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("DeletedAt")
                .HasColumnType("datetime(6)");

                b.Property <string>("Text")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <int>("TopicId")
                .HasColumnType("int");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.Property <int>("UserId")
                .HasColumnType("int");

                b.HasKey("CommentId");

                b.HasIndex("ChapterId");

                b.HasIndex("CourseId");

                b.HasIndex("TopicId");

                b.HasIndex("UserId");

                b.ToTable("comments");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Course", b =>
            {
                b.Property <int>("CourseId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <int?>("CategoryId")
                .HasColumnType("int");

                b.Property <string>("CourseTitle")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <string>("Image")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.Property <int>("UserId")
                .HasColumnType("int");

                b.HasKey("CourseId");

                b.HasIndex("CategoryId");

                b.HasIndex("UserId");

                b.ToTable("courses");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.CourseRate", b =>
            {
                b.Property <int>("CourseRateId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <int>("CourseId")
                .HasColumnType("int");

                b.Property <DateTime>("CratedAt")
                .HasColumnType("datetime(6)");

                b.Property <double>("Rate")
                .HasColumnType("double");

                b.Property <bool>("Status")
                .HasColumnType("tinyint(1)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.HasKey("CourseRateId");

                b.HasIndex("CourseId");

                b.ToTable("course_rate");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.CourseStudent", b =>
            {
                b.Property <int>("CourseStudentId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <int>("CourseId")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("DeletedAt")
                .HasColumnType("datetime(6)");

                b.Property <string>("Status")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.Property <int>("UserId")
                .HasColumnType("int");

                b.HasKey("CourseStudentId");

                b.HasIndex("CourseId");

                b.HasIndex("UserId");

                b.ToTable("course_students");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Topic", b =>
            {
                b.Property <int>("TopicId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <int>("ChapterId")
                .HasColumnType("int");

                b.Property <int>("CourseId")
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("DeletedAt")
                .HasColumnType("datetime(6)");

                b.Property <bool>("IsWatched")
                .HasColumnType("tinyint(1)");

                b.Property <double>("Length")
                .HasColumnType("double");

                b.Property <int>("Order")
                .HasColumnType("int");

                b.Property <string>("TopicName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.Property <int?>("VideoId")
                .HasColumnType("int");

                b.HasKey("TopicId");

                b.HasIndex("ChapterId");

                b.HasIndex("CourseId");

                b.HasIndex("VideoId");

                b.ToTable("topics");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.User", b =>
            {
                b.Property <int>("UserId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <string>("Address")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("Email")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("FirstName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("LastName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("Password")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("PhoneNo")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.Property <string>("Role")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.HasKey("UserId");

                b.ToTable("Users");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Video", b =>
            {
                b.Property <int>("VideoId")
                .ValueGeneratedOnAdd()
                .HasColumnType("int");

                b.Property <DateTime>("CreatedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("DeletedAt")
                .HasColumnType("datetime(6)");

                b.Property <DateTime>("UpdatedAt")
                .HasColumnType("datetime(6)");

                b.Property <string>("VideoName")
                .HasColumnType("longtext CHARACTER SET utf8mb4");

                b.HasKey("VideoId");

                b.ToTable("videos");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Chapter", b =>
            {
                b.HasOne("PragyoSala.Services.Models.Course", "Course")
                .WithMany("Chapters")
                .HasForeignKey("CourseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Course");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Comment", b =>
            {
                b.HasOne("PragyoSala.Services.Models.Chapter", "Chapter")
                .WithMany()
                .HasForeignKey("ChapterId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("PragyoSala.Services.Models.Course", "Course")
                .WithMany()
                .HasForeignKey("CourseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("PragyoSala.Services.Models.Topic", "Topic")
                .WithMany()
                .HasForeignKey("TopicId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("PragyoSala.Services.Models.User", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Chapter");

                b.Navigation("Course");

                b.Navigation("Topic");

                b.Navigation("User");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Course", b =>
            {
                b.HasOne("PragyoSala.Services.Models.Category", "Category")
                .WithMany("Courses")
                .HasForeignKey("CategoryId");

                b.HasOne("PragyoSala.Services.Models.User", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Category");

                b.Navigation("User");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.CourseRate", b =>
            {
                b.HasOne("PragyoSala.Services.Models.Course", "Course")
                .WithMany("Rates")
                .HasForeignKey("CourseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Course");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.CourseStudent", b =>
            {
                b.HasOne("PragyoSala.Services.Models.Course", "Course")
                .WithMany("CourseStudents")
                .HasForeignKey("CourseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("PragyoSala.Services.Models.User", "User")
                .WithMany()
                .HasForeignKey("UserId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.Navigation("Course");

                b.Navigation("User");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Topic", b =>
            {
                b.HasOne("PragyoSala.Services.Models.Chapter", "Chapter")
                .WithMany("Topics")
                .HasForeignKey("ChapterId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("PragyoSala.Services.Models.Course", "Course")
                .WithMany()
                .HasForeignKey("CourseId")
                .OnDelete(DeleteBehavior.Cascade)
                .IsRequired();

                b.HasOne("PragyoSala.Services.Models.Video", "Video")
                .WithMany()
                .HasForeignKey("VideoId");

                b.Navigation("Chapter");

                b.Navigation("Course");

                b.Navigation("Video");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Category", b =>
            {
                b.Navigation("Courses");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Chapter", b =>
            {
                b.Navigation("Topics");
            });

            modelBuilder.Entity("PragyoSala.Services.Models.Course", b =>
            {
                b.Navigation("Chapters");

                b.Navigation("CourseStudents");

                b.Navigation("Rates");
            });
#pragma warning restore 612, 618
        }
Beispiel #59
0
        protected override void BuildModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .HasAnnotation("ProductVersion", "2.2.4-servicing-10062")
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

            modelBuilder.Entity("CrowDo.LinkingTable", b =>
                {
                    b.Property<int>("UserId");

                    b.Property<int>("RewardPackageId");

                    b.Property<int>("ProjectId");

                    b.HasKey("UserId", "RewardPackageId", "ProjectId");

                    b.HasIndex("ProjectId");

                    b.HasIndex("RewardPackageId");

                    b.ToTable("LinkingTable");
                });

            modelBuilder.Entity("CrowDo.Project", b =>
                {
                    b.Property<int>("ProjectId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<DateTime>("CreationDate");

                    b.Property<string>("Description");

                    b.Property<DateTime>("EstimatedDurationInMonths");

                    b.Property<DateTime>("ExpirationDate");

                    b.Property<decimal>("Funds");

                    b.Property<bool>("IsAvailable");

                    b.Property<bool>("IsSuccessful");

                    b.Property<string>("ProjectCategory");

                    b.Property<decimal>("ProjectGoal");

                    b.Property<string>("ProjectName");

                    b.Property<string>("StatusUpdate");

                    b.Property<int?>("UserId");

                    b.Property<int>("Visits");

                    b.HasKey("ProjectId");

                    b.HasIndex("UserId");

                    b.ToTable("Project");
                });

            modelBuilder.Entity("CrowDo.ProjectMedia", b =>
                {
                    b.Property<int>("ProjectMediaId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("FileName");

                    b.Property<int>("ProjectId");

                    b.HasKey("ProjectMediaId");

                    b.HasIndex("ProjectId");

                    b.ToTable("ProjectMedia");
                });

            modelBuilder.Entity("CrowDo.RewardPackage", b =>
                {
                    b.Property<int>("RewardPackageId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("PackageName");

                    b.Property<decimal>("Price");

                    b.Property<int?>("ProjectId");

                    b.Property<string>("RewardName");

                    b.HasKey("RewardPackageId");

                    b.HasIndex("ProjectId");

                    b.ToTable("RewardPackage");
                });

            modelBuilder.Entity("CrowDo.User", b =>
                {
                    b.Property<int>("UserId")
                        .ValueGeneratedOnAdd()
                        .HasAnnotation("SqlServer:ValueGenerationStrategy", SqlServerValueGenerationStrategy.IdentityColumn);

                    b.Property<string>("Address");

                    b.Property<DateTime>("BirthDate");

                    b.Property<int>("CreatedProjectsCount");

                    b.Property<string>("Email");

                    b.Property<string>("Name");

                    b.Property<DateTime>("RegistrationDate");

                    b.HasKey("UserId");

                    b.ToTable("User");
                });

            modelBuilder.Entity("CrowDo.LinkingTable", b =>
                {
                    b.HasOne("CrowDo.Project", "Project")
                        .WithMany("LinkingTables")
                        .HasForeignKey("ProjectId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("CrowDo.RewardPackage", "RewardPackage")
                        .WithMany()
                        .HasForeignKey("RewardPackageId")
                        .OnDelete(DeleteBehavior.Cascade);

                    b.HasOne("CrowDo.User", "User")
                        .WithMany()
                        .HasForeignKey("UserId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("CrowDo.Project", b =>
                {
                    b.HasOne("CrowDo.User")
                        .WithMany("CreatedProjects")
                        .HasForeignKey("UserId");
                });

            modelBuilder.Entity("CrowDo.ProjectMedia", b =>
                {
                    b.HasOne("CrowDo.Project")
                        .WithMany("MultimediaFiles")
                        .HasForeignKey("ProjectId")
                        .OnDelete(DeleteBehavior.Cascade);
                });

            modelBuilder.Entity("CrowDo.RewardPackage", b =>
                {
                    b.HasOne("CrowDo.Project")
                        .WithMany("RewardPackages")
                        .HasForeignKey("ProjectId");
                });
#pragma warning restore 612, 618
        }
        protected override void BuildTargetModel(ModelBuilder modelBuilder)
        {
#pragma warning disable 612, 618
            modelBuilder
                .UseIdentityColumns()
                .HasAnnotation("Relational:MaxIdentifierLength", 128)
                .HasAnnotation("ProductVersion", "5.0.0");

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Bill", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime2");

                    b.Property<Guid>("GroupContextId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("LoanerId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<decimal>("Total")
                        .HasColumnType("decimal(18,2)");

                    b.HasKey("Id");

                    b.HasIndex("GroupContextId");

                    b.HasIndex("LoanerId");

                    b.ToTable("Bills");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Group", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("Groups");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Loan", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<Guid>("BillId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("LoaneeId")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("Id");

                    b.HasIndex("BillId");

                    b.HasIndex("LoaneeId");

                    b.ToTable("Loans");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Payment", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<decimal>("Amount")
                        .HasColumnType("decimal(18,2)");

                    b.Property<DateTime>("CreationTime")
                        .HasColumnType("datetime2");

                    b.Property<Guid>("GroupContextId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("PayerId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("ReceiverId")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("Id");

                    b.HasIndex("GroupContextId");

                    b.HasIndex("PayerId");

                    b.HasIndex("ReceiverId");

                    b.ToTable("Payments");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.User", b =>
                {
                    b.Property<Guid>("Id")
                        .ValueGeneratedOnAdd()
                        .HasColumnType("uniqueidentifier");

                    b.Property<string>("Email")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Name")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.Property<string>("Password")
                        .IsRequired()
                        .HasColumnType("nvarchar(max)");

                    b.HasKey("Id");

                    b.ToTable("Users");
                });

            modelBuilder.Entity("GroupUser", b =>
                {
                    b.Property<Guid>("GroupsId")
                        .HasColumnType("uniqueidentifier");

                    b.Property<Guid>("UsersId")
                        .HasColumnType("uniqueidentifier");

                    b.HasKey("GroupsId", "UsersId");

                    b.HasIndex("UsersId");

                    b.ToTable("GroupUser");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Bill", b =>
                {
                    b.HasOne("BillChopBE.DataAccessLayer.Models.Group", "GroupContext")
                        .WithMany("Bills")
                        .HasForeignKey("GroupContextId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("BillChopBE.DataAccessLayer.Models.User", "Loaner")
                        .WithMany("Bills")
                        .HasForeignKey("LoanerId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("GroupContext");

                    b.Navigation("Loaner");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Loan", b =>
                {
                    b.HasOne("BillChopBE.DataAccessLayer.Models.Bill", "Bill")
                        .WithMany("Loans")
                        .HasForeignKey("BillId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("BillChopBE.DataAccessLayer.Models.User", "Loanee")
                        .WithMany("Loans")
                        .HasForeignKey("LoaneeId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("Bill");

                    b.Navigation("Loanee");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Payment", b =>
                {
                    b.HasOne("BillChopBE.DataAccessLayer.Models.Group", "GroupContext")
                        .WithMany()
                        .HasForeignKey("GroupContextId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("BillChopBE.DataAccessLayer.Models.User", "Payer")
                        .WithMany("PaymentsMade")
                        .HasForeignKey("PayerId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.HasOne("BillChopBE.DataAccessLayer.Models.User", "Receiver")
                        .WithMany("PaymentsReceived")
                        .HasForeignKey("ReceiverId")
                        .OnDelete(DeleteBehavior.NoAction)
                        .IsRequired();

                    b.Navigation("GroupContext");

                    b.Navigation("Payer");

                    b.Navigation("Receiver");
                });

            modelBuilder.Entity("GroupUser", b =>
                {
                    b.HasOne("BillChopBE.DataAccessLayer.Models.Group", null)
                        .WithMany()
                        .HasForeignKey("GroupsId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();

                    b.HasOne("BillChopBE.DataAccessLayer.Models.User", null)
                        .WithMany()
                        .HasForeignKey("UsersId")
                        .OnDelete(DeleteBehavior.Cascade)
                        .IsRequired();
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Bill", b =>
                {
                    b.Navigation("Loans");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.Group", b =>
                {
                    b.Navigation("Bills");
                });

            modelBuilder.Entity("BillChopBE.DataAccessLayer.Models.User", b =>
                {
                    b.Navigation("Bills");

                    b.Navigation("Loans");

                    b.Navigation("PaymentsMade");

                    b.Navigation("PaymentsReceived");
                });
#pragma warning restore 612, 618
        }