public class DataContext : IdentityDbContext<User>{ public DataContext(DbContextOptions<DataContext> options) : base(options) { } public DbSet<Product> Products { get; set; } public DbSet<Category> Categories { get; set; } public DbSet<Models.Type> Types { get; set; } protected override void OnModelCreating(ModelBuilder modelBuilder) { base.OnModelCreating(modelBuilder); modelBuilder.Entity<Product>() .HasOne(p => p.Seller) .WithMany(u => u.Products) .HasForeignKey(p => p.SellerId); }}
public class User : IdentityUser{ public int Id { get; set; } public string Name { get; set; } public string FirstName { get; set; } public string LastName { get; set; } public string? Facebook { get; set; } public string? Instagram { get; set; } public string? WhatsApp { get; set; } public string Location { get; set; } public ICollection<Product> Products { get; set; }}