Exemplo n.º 1
0
        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);
        }
Exemplo n.º 2
0
        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);
            }
        }