public void Edit(Article article) { var currentArticle = db.Set <Article>().Find(article.ArticleId); currentArticle.Name = article.Name; currentArticle.TextOfArticle = article.TextOfArticle; db.Entry(currentArticle).State = EntityState.Modified; db.SaveChanges(); }
public async Task <T> GetByIdAsync(int id) { return(await _context.Set <T>().FindAsync(id)); }