public void AddAnnouncement(ViewAnnouncement value)
 {
     var announcement = AutoMapper.Mapper.Map<ViewAnnouncement, Announcement>(value);
     this.unitOfWork.AnnouncementRepository.Add(announcement);
     logger.Info("Add announcement {0}", announcement.Title);
     this.unitOfWork.SaveChanges();
 }
 public void UpdateAnnouncement(int id, ViewAnnouncement value)
 {
     var announcement = this.unitOfWork.AnnouncementRepository.GetById(id);
     AutoMapper.Mapper.Map<ViewAnnouncement, Announcement>(value, announcement);
     this.unitOfWork.AnnouncementRepository.Update(announcement);
     logger.Info("Update announcement {0}", announcement.Title);
     this.unitOfWork.SaveChanges();
 }