public UsuarioService( MarketPlaceContext context, IMapper mapper) { _context = context; _mapper = mapper; }
public void CreateTestData(DbContextOptions <MarketPlaceContext> options) { using (var appcontext = new MarketPlaceContext(options)) { var ApplicationsToAdd = new List <Application> { new Application() { Id = 1, Name = "Github", Info = "Github Integration", AppUrl = "www.github.com", Developer = "Mr. XYZ", LogoUrl = "www.logo.com" }, new Application() { Id = 2, Name = "Google Drive", Info = "Google Drive Integration", AppUrl = "www.googledrive.com", Developer = "Mr. ABC", LogoUrl = "www.glogo.com" } }; appcontext.Application.AddRange(ApplicationsToAdd); appcontext.SaveChanges(); } }
// // GET: /MarketPlace/ public ActionResult Index() { ViewBag.ActiveNavItem = "marketplace"; MarketPlaceContext db = new MarketPlaceContext(); IEnumerable <MarketPlace> tables = db.MarketPlace.AsEnumerable(); return(View(tables)); }
public ApplicationsController GetController() { var optionsBuilder = new DbContextOptionsBuilder <MarketPlaceContext>(); optionsBuilder.UseInMemoryDatabase(Guid.NewGuid().ToString()); var appcontext = new MarketPlaceContext(optionsBuilder.Options); CreateTestData(optionsBuilder.Options); return(new ApplicationsController(appcontext)); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, MarketPlaceContext context) { if (env.IsDevelopment()) { app.UseDeveloperExceptionPage(); } app.UseCors("default"); app.UseMvc(); DbInitializer.Initialize(context); }
public UserRepository(MarketPlaceContext context) : base(context) { }
public Repository(MarketPlaceContext context) { _context = context; _table = _context.Set <T>(); }
public ProductTypeRepository(MarketPlaceContext context) : base(context) { }
public ApplicationsController(MarketPlaceContext context) { _context = context; }
public AdminController() { context = new MarketPlaceContext(); }
// This method gets called by the runtime. Use this method to configure the HTTP request pipeline. public void Configure(IApplicationBuilder app, IHostingEnvironment env, ILoggerFactory loggerFactory, MarketPlaceContext context) { loggerFactory.AddConsole(Configuration.GetSection("Logging")); loggerFactory.AddDebug(); app.UseCors("default"); app.UseSwagger(); app.UseSwaggerUI(c => { c.SwaggerEndpoint("/swagger/v1/swagger.json", "MarketPlace API V1"); }); app.UseIdentityServerAuthentication(new IdentityServerAuthenticationOptions { Authority = "http://localhost:5002", RequireHttpsMetadata = false, ApiName = "MarketplaceService" }); app.UseMvc(); DbInitializer.Initialize(context); }
public MessageRepository(MarketPlaceContext context) : base(context) { }
public CartRepository() { context = new MarketPlaceContext(); }
public DevicesService(MarketPlaceContext marketPlaceContext, ILogger <DevicesService> logger) { _logger = logger; _dbContext = marketPlaceContext; }
public SubCategoryRepository() { context = new MarketPlaceContext(); }
public TrendsService(MarketPlaceContext marketPlaceContext, ILogger <TrendsService> logger) { _logger = logger; _MarketPlaceContext = marketPlaceContext; }
public AttributeTypeRepository(MarketPlaceContext context) : base(context) { }
public PointsService(MarketPlaceContext marketPlaceContext, ILogger <PointsService> logger) { _logger = logger; _MarketPlaceContext = marketPlaceContext; }