public void InitializeTests() { this.context = MockDbContext.GetContext(); this.service = new AdminRewardsService(context, MockAutoMapper.GetMapper()); CreateInitialEvents(); }
public static void SeedData(this IApplicationBuilder app) { using (IServiceScope serviceScope = app.ApplicationServices.GetRequiredService <IServiceScopeFactory>().CreateScope()) { AbraksContext db = serviceScope.ServiceProvider.GetService <AbraksContext>(); DanceType initialDance = db.DanceTypes.FirstOrDefault(t => t.Name == "Folklor"); if (initialDance == null) { db.DanceTypes.Add(new DanceType() { Name = "Folklor" }); db.DanceTypes.Add(new DanceType() { Name = "Salsa" }); } db.SaveChanges(); Event initialEvent = db.Events.FirstOrDefault(c => c.Name == "Gergiovden"); if (initialEvent == null) { db.Events.Add(new Event() { Name = "Gergiovden", Place = "Stefanovo", Address = "Stefanovo", Dance = initialDance, PosterUrl = "https://imageshack.com/a/img924/5145/O5s8hO.jpg", StartDate = DateTime.Now, EndDate = DateTime.Now.AddDays(2) }); } db.SaveChanges(); } }
public AdminRewardsService(AbraksContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
public UsersController(AbraksContext context, IMapper mapper, UserManager <User> userManager) { this.context = context; this.mapper = mapper; this.userManager = userManager; }
public AdminEventsService(AbraksContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
public DancerCommentsService(AbraksContext dbContext, IMapper mapper) : base(dbContext, mapper) { }
protected BaseAbraksService(AbraksContext dbContext, IMapper mapper) { this.DbContext = dbContext; this.Mapper = mapper; }