//https://exceptionnotfound.net/ef-core-inmemory-asp-net-core-store-database/ public static void Initialize(IServiceProvider serviceProvider) { using (var context = new LavanderiaContext( serviceProvider.GetRequiredService <DbContextOptions <LavanderiaContext> >())) { // Look for any board games. if (context.Usuarios.Any()) { return; // Data was already seeded } context.Usuarios.AddRange( new Usuario { Id = 1, Login = "******", Senha = "Hasbro", }, new Usuario { Id = 2, Login = "******", Senha = "Hasbro", }, new Usuario { Id = 3, Login = "******", Senha = "Days of Wonder", }, new Usuario { Id = 4, Login = "******", Senha = "Catan Studio", }, new Usuario { Id = 5, Login = "******", Senha = "Z-Man Games", }, new Usuario { Id = 6, Login = "******", Senha = "Jax Games", }); context.SaveChanges(); } }
public Repository(LavanderiaContext context) { _context = context; _dbSet = _context.Set <TEntity>(); }
public UnitOfWork(LavanderiaContext context) { _context = context; }
public ClienteRepository(LavanderiaContext context) : base(context) { }
public OrdemServicoRepository(LavanderiaContext context) : base(context) { }
public UsuarioRepository(LavanderiaContext context) : base(context) { }
public ItemOrdemRepository(LavanderiaContext context) : base(context) { }
public ClientesController(LavanderiaContext context) { _context = context; }