Exemplo n.º 1
0
        private void ItemPanel_Load(object sender, EventArgs e)
        {
            FoodDBContext dbContext = new FoodDBContext();
            var           qeury     = from item in dbContext.FoodItems orderby item.ItemName ascending select item.ItemName;

            string[] ItemArray = qeury.ToArray();

            cmbItemList.Items.AddRange(ItemArray);
        }
Exemplo n.º 2
0
        // This method gets called by the runtime. Use this method to add services to the container.
        public void ConfigureServices(IServiceCollection services)
        {
            services.AddCors(Options =>
            {
                Options.AddPolicy("VueCorsPolicy", build =>
                {
                    build.AllowAnyHeader()
                    .AllowAnyMethod()
                    .AllowCredentials()
                    .WithOrigins("http://localhost:8080");
                });
            });


            services.AddMvc().SetCompatibilityVersion(CompatibilityVersion.Version_2_1);

            var connStr       = Configuration.GetConnectionString("FoodDatabase");
            var foodDbContext = new FoodDBContext(connStr);

            services.AddSingleton(foodDbContext);
        }
Exemplo n.º 3
0
 public FoodCategoryController(FoodDBContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 4
0
 public FoodInfoController(FoodDBContext dbContext)
 {
     _dbContext = dbContext;
 }
Exemplo n.º 5
0
 public BusinessHelper()
 {
     dbContext = new FoodDBContext();
 }