public long insert(Category entity)
 {
     try
     {
         db.Categories.Add(entity);
         db.SaveChanges();
         return entity.id;
     }
     catch
     {
         return -1;
     }
 }
 public bool update(Category entity)
 {
     try
     {
         Category cat = db.Categories.Find(entity.id);
         cat.ModifiedAt = DateTime.Now;
         cat.ModifiedBy = entity.ModifiedBy;
         cat.Name = entity.Name;
         cat.ParentID = entity.ParentID;
         cat.Status = entity.Status;
         db.SaveChanges();
         return true;
     }
     catch
     {
         return false;
     }
 }