Exemplo n.º 1
0
        /// <summary>
        /// 汎用更新リポジトリ
        /// </summary>
        /// <param name="entity">更新する汎用Entity</param>
        /// <typeparam name="T">エンティティ</typeparam>
        /// <returns>処理件数</returns>
        public virtual async Task <int> Update <T>(T entity)
            where T : ModelBase
        {
            _context.Entry(entity).State = EntityState.Modified;
            int result = await _context.SaveChangesAsync();

            return(result);
        }
        public void Update(T New, int Id)
        {
            T Old = GetByID(Id);

            _db.Entry(Old).CurrentValues.SetValues(New);
        }
Exemplo n.º 3
0
 public void UpdateCompany(Company company)
 {
     _context.Entry(company).State = EntityState.Modified;
 }