Esempio n. 1
0
        public TGenero SaveTGenero(TGenero tGenero)
        {
            using (var dbContextTransaction = Context.Database.BeginTransaction())
            {
                try
                {
                    Context.TGeneroes.AddOrUpdate(tGenero);
                    Context.SaveChanges();

                    dbContextTransaction.Commit();

                    return(tGenero);
                }
                catch (Exception ex)
                {
                    dbContextTransaction.Rollback();

                    System.Diagnostics.Debug.WriteLine(ex.Message);
                    return(null);
                }
            }
        }
Esempio n. 2
0
 public TGenero SaveTGenero(TGenero tGenero)
 {
     return(_repositoryTGeneroes.SaveTGenero(tGenero));
 }