/// <summary>
        /// Crea un nuevo elemento
        /// </summary>
        /// <param name="entity">Entidad con datos</param>
        public TipoDocumento Create(TipoDocumento entity)
        {
            var result = _repository.Create(entity);

            _repository.Save();
            return(result);
        }
 public TipoDocumento Create(TipoDocumento tipoDoc)
 {
     using (var context = new ApplicationDbContext())
     {
         ApplicationDbContext.applicationDbContext = context;
         using (var dbContextTransaction = context.Database.BeginTransaction())
         {
             try
             {
                 tipoDoc = tipoDocumentoRepository.Create(tipoDoc);
                 context.SaveChanges();
                 dbContextTransaction.Commit();
             }
             catch (Exception ex)
             {
                 dbContextTransaction.Rollback();
                 throw new Exception("He hecho rollback de la transaccion", ex);
             }
         }
         return(tipoDoc);
     }
 }