Esempio n. 1
0
 public static bool AddRange(IEnumerable <Core.Models.Like> entities)
 {
     try
     {
         using (var ctx = new Data.AmstramgramContext())
         {
             var LikeRepo = new Data.Repositories.LikeRepository(ctx, null);
             LikeRepo.AddRange(entities);
             return(LikeRepo.SaveChanges());
         }
     }
     catch
     {
         return(false);
     }
 }
Esempio n. 2
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);
     }
 }
Esempio n. 3
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);
     }
 }