Exemplo n.º 1
0
 public static bool Delete(Core.Models.Like entity)
 {
     try
     {
         using (var ctx = new Data.AmstramgramContext())
         {
             var LikeRepo = new Data.Repositories.LikeRepository(ctx, null);
             LikeRepo.Delete(entity);
             return(LikeRepo.SaveChanges());
         }
     }
     catch
     {
         return(false);
     }
 }
Exemplo n.º 2
0
 public static Core.Models.Like Add(Core.Models.Like entity)
 {
     try
     {
         using (var ctx = new Data.AmstramgramContext())
         {
             var LikeRepo = new Data.Repositories.LikeRepository(ctx, null);
             var result   = LikeRepo.Add(entity);
             if (!LikeRepo.SaveChanges())
             {
                 return(null);
             }
             return(result);
         }
     }
     catch
     {
         return(null);
     }
 }