Пример #1
0
 public static bool Delete(Genres genre)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             db.Entry(genre).State = System.Data.Entity.EntityState.Deleted;
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }
Пример #2
0
 public static bool Insert(Genres genre)
 {
     using (FotografPaketiEntities db = new FotografPaketiEntities())
     {
         try
         {
             genre.DeleteStatus = false;
             db.Genres.Add(genre);
             db.SaveChanges();
             return true;
         }
         catch (Exception ex)
         {
             return false;
             throw;
         }
     }
 }