예제 #1
0
        public void initContext()
        {
            var options = new DbContextOptionsBuilder<DbRestauranteContext>()
             .UseInMemoryDatabase(databaseName: "Test_NxRestaurante").Options;
            // Set up a context (connection to the "DB") for writing
            using (var _context = new DbRestauranteContext(options))
            {
                _context.TipoIdentificacion.AddAsync(new Entities.TipoIdentificacion { descripcion = "CC" });
                _context.TipoIdentificacion.AddAsync(new Entities.TipoIdentificacion { descripcion = "TI" });
                _context.TipoIdentificacion.AddAsync(new Entities.TipoIdentificacion { descripcion = "CE" });
                _context.SaveChangesAsync();

                _context.Usuario.AddAsync(new Entities.Usuario
                {
                    identidad = "1017143560",
                    nombre = "Milker",
                    apellido = "Sanchez",
                    contrasenia = "123456",
                    email = "*****@*****.**",
                    tipo = new Entities.TipoIdentificacion { id = 1, descripcion = "CC" }
                });
                _context.SaveChangesAsync();

                dbCarvajalTestContext = _context;
            }


        }
예제 #2
0
 public CocinerosController(DbRestauranteContext context)
 {
     _context = context;
 }
예제 #3
0
 public DetalleFacturasController(DbRestauranteContext context)
 {
     _context = context;
 }
 public MesasController(DbRestauranteContext context)
 {
     _context = context;
 }
예제 #5
0
 public ClientesController(DbRestauranteContext context)
 {
     _context = context;
 }