public DTO.Article Delete(DTO.Article item) { DAL.Context.Article entity = repository.Get(item.ArticleId); repository.Delete(entity); repository.SaveChanges(); return(item); }
public Article(DTO.Article article) { Id = Guid.NewGuid(); Title = article.Title; CreatedOn = DateTime.Now; Text = article.Text; IsAccepted = null; CategoryId = article.CategoryId; UserId = article.AuthorId; }
public void CreateOrUpdate(DTO.Article item) { DAL.Context.Article entity = mapper.Map <DTO.Article, DAL.Context.Article>(item); repository.CreateOrUpdate(entity); repository.SaveChanges(); }