示例#1
0
 public DTO.Article Delete(DTO.Article item)
 {
     DAL.Context.Article entity = repository.Get(item.ArticleId);
     repository.Delete(entity);
     repository.SaveChanges();
     return(item);
 }
示例#2
0
 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;
 }
示例#3
0
 public void CreateOrUpdate(DTO.Article item)
 {
     DAL.Context.Article entity = mapper.Map <DTO.Article, DAL.Context.Article>(item);
     repository.CreateOrUpdate(entity);
     repository.SaveChanges();
 }