コード例 #1
0
        public int InsertAccountType(AccountType accountType)
        {
            context.AccountTypes.Add(accountType);
            context.SaveChanges();

            return accountType.Id;
        }
コード例 #2
0
        public void UpdateAccountType(AccountType accountType)
        {
            AccountType dbAccountType = context.AccountTypes.Find(accountType.Id);

            if (dbAccountType != null)
            {
                dbAccountType.Name = accountType.Name;
                context.SaveChanges();
            }
        }