public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILoggerFactory loggerFactory, PruebaContext albumContext, IConfiguration configuration) { Log.Logger = new LoggerConfiguration() .WriteTo.RollingFile(pathFormat: "logs\\log-{Date}.log") .CreateLogger(); loggerFactory.AddSerilog(); app.UseDeveloperExceptionPage(); Console.WriteLine("\r\nPlatform: " + System.Runtime.InteropServices.RuntimeInformation.OSDescription); string useSqLite = Configurations["Data:useSqLite"]; Console.WriteLine(useSqLite == "true" ? "SqLite" : "Sql Server"); app.UseRouting(); app.UseCors("CorsPolicy"); app.UseAuthentication(); app.UseAuthorization(); app.UseStatusCodePages(); app.UseDefaultFiles(); app.UseStaticFiles(); app.UseSwagger(); app.UseEndpoints(endpoints => { endpoints.MapControllers(); }); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "Prueba Técnica .NET Core API v1"); }); }
public static List <TareasMascota> getTareasMascotas(PruebaContext context) { return(new List <TareasMascota>() { new TareasMascota { Fecha_ejec = new DateTime(2018, 09, 10), MascotaId = context.Mascotas.First().Id, TareaId = context.Tareas.FirstOrDefault(x => x.Codigo == "ALM").Id } }); }
public static List <Mascota> getMascotas(PruebaContext context) { return(new List <Mascota>() { new Mascota { Nombre = "Benji", Apodo = "Bento", Fecha_nac = new DateTime(2017, 8, 23), Sexo = "M", ClienteId = context.Users.First().Id, RazaId = context.Razas.FirstOrDefault(x => x.Codigo == "PUG").Id } }); }
public static List <Tienda> getTiendas(PruebaContext context) { return(new List <Tienda>() { new Tienda { Codigo = "AZ01", Nombre = "Mi mascota feliz", CiudadId = context.Ciudades.FirstOrDefault(x => x.Codigo == "BOG").Id } }); }
public EnrollmentsController(PruebaContext context, StudentHelper Helper, CourseHelper CourseHelper, QualificationHelper QualificationHelper) { _context = context; _studentHelper = Helper; _courseHelper = CourseHelper; _QualificationHelper = QualificationHelper; }
public static List <ApplicationUser> getClientes(PruebaContext context) { var hash = new PasswordHasher(); return(new List <ApplicationUser>() { new ApplicationUser { UserName = "******", Cedula = 1234567, PasswordHash = hash.HashPassword("Ideaware"), Nombre = "Pepe", Apellido = "Grillo", Email = "*****@*****.**", Direccion = "calle 10 # 10 - 10", Fecha_nac = new DateTime(1970, 1, 19), Sexo = "M", PhoneNumber = "3008549876", TiendaId = context.Tiendas.FirstOrDefault(x => x.Codigo == "AZ01").Id, SecurityStamp = Guid.NewGuid().ToString() } }); }
public AsignaturasController(PruebaContext context, AsignaturasRepository repository, IServiceProvider svcProvider, IConfiguration config, ILogger <AsignaturasController> logger, IWebHostEnvironment env ) { Context = context; Repository = repository; serviceProvider = svcProvider; Configuration = config; Logger = logger; HostingEnv = env; }
public Test_Implementation() { var builder = new ConfigurationBuilder() .SetBasePath(AppContext.BaseDirectory) .AddJsonFile("appsettings.json", optional: true, reloadOnChange: true) .AddEnvironmentVariables(); Configurations = builder.Build(); _DbContextOptionsBuilder = new DbContextOptionsBuilder(); _DbContextOptionsBuilder.UseSqlServer(Configurations["Data:SqlServerConnectionString"]); _Context = new PruebaContext(_DbContextOptionsBuilder.Options); _ContextMock = new Mock <PruebaContext>(_DbContextOptionsBuilder.Options); _ContextMock.SetupAllProperties(); _RepositoryMock = new Mock <T1>(_Context); _ServiceMock = new Mock <IServiceProvider>(); _ConfigurationMock = new Mock <IConfiguration>(); _LogMock = new Mock <ILogger <T2> >(); _EnvironmentMock = new Mock <IWebHostEnvironment>(); }
public static List <Tarea> getTareas(PruebaContext context) { return(new List <Tarea>() { new Tarea { Codigo = "SLP", Nombre = "Salida al parque", Costo = 1000, TipoId = context.TipoTareas.FirstOrDefault(x => x.Codigo == "CMP").Id }, new Tarea { Codigo = "ENT", Nombre = "Entrenamiento", Costo = 5000, TipoId = context.TipoTareas.FirstOrDefault(x => x.Codigo == "CMP").Id }, new Tarea { Codigo = "VCN", Nombre = "Vacunas", Costo = 10000, TipoId = context.TipoTareas.FirstOrDefault(x => x.Codigo == "CMP").Id }, new Tarea { Codigo = "IGN", Nombre = "Inspección general", Costo = 8000, TipoId = context.TipoTareas.FirstOrDefault(x => x.Codigo == "CAS").Id }, new Tarea { Codigo = "ALM", Nombre = "Alimentación", Costo = 12500, TipoId = context.TipoTareas.FirstOrDefault(x => x.Codigo == "CAS").Id }, }); }
public ListasComponent(PruebaContext db) { _db = db; }
public QualificationHelper(PruebaContext context) { _context = context; }
public UnitOfWork() { dbContext = new PruebaContext(); }
public UnitOfWork(PruebaContext PruebaContext) { dbContext = PruebaContext; }
public StudentsController(PruebaContext context, StudentHelper Helper) { _context = context; _studentHelper = Helper; }
public CoursesController(PruebaContext context) { _context = context; }
public OtsController(PruebaContext context) { _context = context; }
public CourseHelper(PruebaContext context) { _context = context; }
public QualificationsController(PruebaContext context) { _context = context; }
public Repository(PruebaContext pruebaContext) { this.dbContext = pruebaContext; this.dbSet = dbContext.Set <TEntity>(); }
public Notifications(IConfiguration configuration, IHubContext <ChatHub> chatHub, PruebaContext context) { configuration = _configuration; chatHub = _chatHub; context = _context; }
public TicketController(PruebaContext db, INotify serv) { _db = db; _serv = serv; }
public StudentHelper(PruebaContext context) { _context = context; }