예제 #1
0
        // GET: Categories/Create
        public IActionResult Create(int?id)
        {
            if (id == null)
            {
                return(NotFound());
            }

            var category = new Category()
            {
                HouseholdId = (int)id
            };

            ViewData["HouseholdId"] = new SelectList(_context.Set <Household>(), "Id", "Id");
            return(View(category));
        }
예제 #2
0
 public BaseRepository(ApplicationsDbContext dbContext)
 {
     context = dbContext;
     dbSet   = context.Set <T>();
 }