Ejemplo n.º 1
0
 public void Configure(EntityTypeBuilder <Category> builder)
 {
     MapBaseExtension.Map <Category>(builder);
     builder.Property(x => x.Title).HasColumnType("varchar(200)").IsRequired();
     builder.Property(x => x.Icon).HasColumnType("varchar(400)").IsRequired();
     builder.HasOne(x => x.UserCreate).WithMany().HasForeignKey("UserCreateId");
 }
Ejemplo n.º 2
0
 public void Configure(EntityTypeBuilder <ProductSize> builder)
 {
     MapBaseExtension.Map <ProductSize>(builder);
     builder.Property(x => x.Size).HasColumnType("varchar(10)").IsRequired();
     //builder.HasOne(x => x.Product).WithMany().HasForeignKey("ProductId");
     builder.HasOne(x => x.UserCreate).WithMany().HasForeignKey("UserCreateId");
 }
Ejemplo n.º 3
0
 public void Configure(EntityTypeBuilder <Coupon> builder)
 {
     MapBaseExtension.Map <Coupon>(builder);
     builder.Property(x => x.Reference).HasColumnType("varchar(80)").IsRequired();
     builder.Property(x => x.Percent).IsRequired();
     builder.Property(x => x.Active).IsRequired();
     builder.Property(x => x.ExpirationDate);
 }
Ejemplo n.º 4
0
 public void Configure(EntityTypeBuilder <Product> builder)
 {
     MapBaseExtension.Map <Product>(builder);
     builder.Property(x => x.Title).HasColumnType("varchar(200)").IsRequired();
     builder.Property(x => x.Description);
     builder.Property(x => x.Price).IsRequired();
     builder.HasOne(x => x.Category).WithMany().HasForeignKey("CategoryId");
     builder.HasOne(x => x.UserCreate).WithMany().HasForeignKey("UserCreateId");
 }
Ejemplo n.º 5
0
        public void Configure(EntityTypeBuilder <OrderItem> builder)
        {
            MapBaseExtension.Map <OrderItem>(builder);
            builder.Property(x => x.Size).IsRequired();
            builder.Property(x => x.Quantity).IsRequired();
            builder.Property(x => x.Price).IsRequired();

            builder.HasOne(x => x.Product).WithMany().HasForeignKey("ProductId");
            builder.HasOne(x => x.Order).WithMany().HasForeignKey("OrderId");
        }
Ejemplo n.º 6
0
        public void Configure(EntityTypeBuilder <Order> builder)
        {
            MapBaseExtension.Map <Order>(builder);
            builder.Property(x => x.TotalProducts).IsRequired();
            builder.Property(x => x.TotalDiscount).IsRequired();
            builder.Property(x => x.TotalOrder).IsRequired();
            builder.Property(x => x.Status).IsRequired();

            builder.HasOne(x => x.User).WithMany().HasForeignKey("UseId");
        }
Ejemplo n.º 7
0
 public void Configure(EntityTypeBuilder <UserToken> builder)
 {
     MapBaseExtension.Map <UserToken>(builder);
     builder.Property(x => x.ExpirationDate).IsRequired();
     builder.Property(x => x.Token).HasColumnType("varchar(100)").IsRequired();
     builder.Property(x => x.Active).IsRequired();
     builder.Property(x => x.AccessDate);
     builder.Property(x => x.Type).IsRequired();
     builder.HasOne(x => x.User).WithMany().HasForeignKey("UserId");
 }
Ejemplo n.º 8
0
        public void Configure(EntityTypeBuilder <User> builder)
        {
            MapBaseExtension.Map <User>(builder);
            builder.Property(x => x.Name).HasColumnType("varchar(200)").IsRequired();
            builder.Property(x => x.Email).HasColumnType("varchar(200)").IsRequired();
            builder.Property(x => x.Password).HasColumnType("varchar(100)").IsRequired();

            builder.HasIndex(t => t.Email)
            .IsUnique();
        }
Ejemplo n.º 9
0
 public void Configure(EntityTypeBuilder <Cart> builder)
 {
     MapBaseExtension.Map <Cart>(builder);
     builder.Property(x => x.Size).HasColumnType("varchar(20)");
     builder.Property(x => x.Quantity).IsRequired();
     builder.HasOne(x => x.User).WithMany().HasForeignKey("UserId");
     builder.HasOne(x => x.Product).WithMany().HasForeignKey("ProductId");
     builder.Property(x => x.Origin).IsRequired();
     builder.Property(x => x.Status).IsRequired();
 }
Ejemplo n.º 10
0
 public void Configure(EntityTypeBuilder <Place> builder)
 {
     MapBaseExtension.Map <Place>(builder);
     builder.Property(x => x.Title).HasColumnType("varchar(200)").IsRequired();
     builder.Property(x => x.Telephone).HasColumnType("varchar(40)").IsRequired();
     builder.Property(x => x.Latitude).IsRequired();
     builder.Property(x => x.Longitude).IsRequired();
     builder.Property(x => x.Image).HasColumnType("varchar(400)").IsRequired();
     builder.Property(x => x.Address).HasColumnType("varchar(200)").IsRequired();
     builder.Property(x => x.VisibleOnApp).IsRequired().HasDefaultValue(false);
 }
Ejemplo n.º 11
0
 public void Configure(EntityTypeBuilder <Banner> builder)
 {
     MapBaseExtension.Map <Banner>(builder);
     builder.Property(x => x.Title).HasColumnType("varchar(200)").IsRequired();
     builder.Property(x => x.Image).HasColumnType("varchar(400)").IsRequired();
     builder.Property(x => x.Url).HasColumnType("varchar(400)");
     builder.Property(x => x.Pos).HasColumnType("int").IsRequired();
     builder.Property(x => x.X).HasColumnType("int").IsRequired();
     builder.Property(x => x.Y).HasColumnType("int").IsRequired();
     builder.Property(x => x.Local).HasColumnType("int").IsRequired();
     builder.HasOne(x => x.UserCreate).WithMany().HasForeignKey("UserCreateId");
 }