public DashboardController(UserManager <User> userManager, EatContext appDbContext, IHttpContextAccessor httpContextAccessor, IStringLocalizer localizer) { _caller = httpContextAccessor.HttpContext.User; _appDbContext = appDbContext; _localizer = localizer; }
public Startup(IConfiguration configuration) { Configuration = configuration; using (var context = new EatContext()) { context.Database.EnsureCreated(); } }
private IStringLocalizer CreateStringLocalizer() { EatContext _db = new EatContext( new DbContextOptionsBuilder <EatContext>() .UseSqlServer(_connectionString) .Options); // инициализация базы данных if (!_db.Cultures.Any()) { _db.AddRange( new Culture { Name = "en", Resources = new List <Resource>() { new Resource { Key = "Header", Value = "Hello" }, new Resource { Key = "Message", Value = "Welcome" } } }, new Culture { Name = "ru", Resources = new List <Resource>() { new Resource { Key = "Header", Value = "Привет" }, new Resource { Key = "Message", Value = "Добро пожаловать" } } }, new Culture { Name = "uk", Resources = new List <Resource>() { new Resource { Key = "Header", Value = "Привіт" }, new Resource { Key = "Message", Value = "Ласкаво просимо" } } } ); _db.SaveChanges(); } return(new EFStringLocalizer(_db)); }
public CartRepository() { this.db = new EatContext(); }
public CustomerRepository() { this.db = new EatContext(); }
public IngredientRepository() { this.db = new EatContext(); }
public FavouriteDishRepository() { this.db = new EatContext(); }
public ProductRepository() { this.db = new EatContext(); }
public MealTimeRepository() { this.db = new EatContext(); }
public EFStringLocalizer(EatContext db) { _db = db; }
public MenuRepository() { this.db = new EatContext(); }
public BoxMigrationRepository() { this.db = new EatContext(); }
public DishRepository() { this.db = new EatContext(); }
public AccountController(UserManager <User> userManager, IMapper mapper, EatContext appDbContext) { _userManager = userManager; _mapper = mapper; _appDbContext = appDbContext; }
public DeliveryAddressRepository() { this.db = new EatContext(); }
public FoodStyleProductRepository() { this.db = new EatContext(); }
public FoodOrderRepository() { this.db = new EatContext(); }
public RestaurantRepository() { this.db = new EatContext(); }