Last active
September 5, 2020 19:20
-
-
Save juniormayhe/e9b22c294243632034b7eefb31a02b44 to your computer and use it in GitHub Desktop.
Contextos
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Entidades.Modelo; | |
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore; | |
namespace Proyecto | |
{ | |
public class MiClaseParaDatosContext : DbContext | |
{ | |
public MiClaseParaDatosContext(DbContextOptions<MiClaseParaDatosContext> options) : base(options) | |
{ | |
} | |
public DbSet<Product> Products { get; set; } | |
public DbSet<ProductBrand> ProductBrands { get; set; } | |
public DbSet<ProductType> ProductTypes { get; set; } | |
public DbSet<Order> Orders { get; set; } | |
public DbSet<OrderItem> OrderItems { get; set; } | |
public DbSet<DeliveryMethod> DeliveryMethods { get; set; } | |
protected override void OnModelCreating(ModelBuilder modelBuilder) | |
{ | |
base.OnModelCreating(modelBuilder); | |
modelBuilder.ApplyConfigurationsFromAssembly(Assembly.GetExecutingAssembly()); | |
} | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Entidades.ModeloIdentity; | |
using Microsoft.AspNetCore.Identity.EntityFrameworkCore; | |
using Microsoft.EntityFrameworkCore; | |
namespace Proyecto | |
{ | |
public class MiClaseParaIdentityContext : IdentityDbContext<AppUser> | |
{ | |
public MiClaseParaIdentityContext(DbContextOptions<MiClaseParaIdentityContext> options) : base(options) | |
{ | |
} | |
protected override void OnModelCreating(ModelBuilder builder) | |
{ | |
base.OnModelCreating(builder); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment