public void Update(BlogEntryTag entity) { /* Not used UnitOfWork attribute, because this method only calls one repository method and repoository can manage it's connection/transaction. */ System.DateTime currentDate = _commonRepository.GetCurrentDateTime(); entity.LastActivityDate = currentDate; entity.LastActivityIdUser = entity.LastActivityIdUser; _repository.Update(entity); }
public BlogEntryTag Create(BlogEntryTag model) { try { Context.BlogEntryTag.Add(model); Context.SaveChanges(); return(model); } catch (Exception ex) { log.Fatal(ex); throw new Exception("DB error", ex.InnerException); } }