コード例 #1
0
ファイル: Repository.cs プロジェクト: younos1986/DDDBanking
        public virtual void Update(T item)
        {
            if (item == null)
            {
                throw new ArgumentNullException("item");
            }

            _dbContext.Entry(item).State = EntityState.Modified;
        }
コード例 #2
0
 public async Task <bool> UpdateAsync(Account account)
 {
     _context.Accounts.Attach(account);
     _context.Entry(account).State = EntityState.Modified;
     try
     {
         return(await _context.SaveChangesAsync() > 0 ? true : false);
     }
     catch (Exception)
     {
     }
     return(false);
 }