Esempio n. 1
0
 public DashboardController(UserManager <User> userManager, EatContext appDbContext,
                            IHttpContextAccessor httpContextAccessor, IStringLocalizer localizer)
 {
     _caller       = httpContextAccessor.HttpContext.User;
     _appDbContext = appDbContext;
     _localizer    = localizer;
 }
Esempio n. 2
0
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

            using (var context = new EatContext())
            {
                context.Database.EnsureCreated();
            }
        }
Esempio n. 3
0
        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));
        }
Esempio n. 4
0
 public CartRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 5
0
 public CustomerRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 6
0
 public IngredientRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 7
0
 public FavouriteDishRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 8
0
 public ProductRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 9
0
 public MealTimeRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 10
0
 public EFStringLocalizer(EatContext db)
 {
     _db = db;
 }
Esempio n. 11
0
 public MenuRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 12
0
 public BoxMigrationRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 13
0
 public DishRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 14
0
 public AccountController(UserManager <User> userManager, IMapper mapper, EatContext appDbContext)
 {
     _userManager  = userManager;
     _mapper       = mapper;
     _appDbContext = appDbContext;
 }
Esempio n. 15
0
 public DeliveryAddressRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 16
0
 public FoodStyleProductRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 17
0
 public FoodOrderRepository()
 {
     this.db = new EatContext();
 }
Esempio n. 18
0
 public RestaurantRepository()
 {
     this.db = new EatContext();
 }