コード例 #1
0
        public async Task <ActionResult> Create([Bind(Include = "Id,Name,HeadOfHousehold")] Household household)
        {
            if (ModelState.IsValid)
            {
                db.Households.Add(household);
                await db.SaveChangesAsync();

                AddHouseholdMember(User.Identity.GetUserId(), household.Id, true);
                ApplicationHelper.AssociateAllBankAccountsWithHousehold();
                await db.SaveChangesAsync();

                return(RedirectToAction("Index"));
            }

            return(View(household));
        }