示例#1
0
 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();
     }
 }
示例#3
0
        //
        // 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));
        }
示例#5
0
        // 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);
        }
示例#6
0
 public UserRepository(MarketPlaceContext context) : base(context)
 {
 }
示例#7
0
 public Repository(MarketPlaceContext context)
 {
     _context = context;
     _table   = _context.Set <T>();
 }
示例#8
0
 public ProductTypeRepository(MarketPlaceContext context) : base(context)
 {
 }
 public ApplicationsController(MarketPlaceContext context)
 {
     _context = context;
 }
 public AdminController()
 {
     context = new MarketPlaceContext();
 }
示例#11
0
        // 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();
 }
示例#16
0
 public TrendsService(MarketPlaceContext marketPlaceContext, ILogger <TrendsService> logger)
 {
     _logger             = logger;
     _MarketPlaceContext = marketPlaceContext;
 }
示例#17
0
 public AttributeTypeRepository(MarketPlaceContext context) : base(context)
 {
 }
示例#18
0
 public PointsService(MarketPlaceContext marketPlaceContext, ILogger <PointsService> logger)
 {
     _logger             = logger;
     _MarketPlaceContext = marketPlaceContext;
 }