コード例 #1
0
 public async Task <Palestrante> AddPalestrantes(Palestrante model)
 {
     try
     {
         _geralPersistence.Add(model);
         if (await _geralPersistence.SaveChangesAsync())
         {
             return(await _palestrantePersistence.GetPalestranteByIdAsync(model.Id, false));
         }
         return(null);
     }
     catch (Exception e)
     {
         throw new Exception(e.Message);
     }
 }
コード例 #2
0
 async Task <Palestrante> IPalestranteService.AddPalestrante(Palestrante model)
 {
     try
     {
         _geralPersistence.Add <Palestrante>(model);
         if (await _geralPersistence.SaveChangesAsync())
         {
             return(await _palestratePersistence.GetPalestranteByIdAsync(model.Id, false));
         }
         return(null);
     }
     catch (System.Exception e)
     {
         throw new System.Exception(e.Message);
     }
 }