public bool Delete(UnionManager.Models.DomainModels.Role entity, bool autoSave = true)
 {
     try
     {
         db.Entry(entity).State = System.Data.Entity.EntityState.Deleted;
         if (autoSave)
         {
             bool result = Convert.ToBoolean(db.SaveChanges());
             return(result);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
 public bool Add(UnionManager.Models.DomainModels.Role entity, bool autoSave = true)
 {
     try
     {
         db.Roles.Add(entity);
         if (autoSave)
         {
             bool result = Convert.ToBoolean(db.SaveChanges());
             return(result);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }
 public bool Update(UnionManager.Models.DomainModels.Role entity, bool autoSave = true)
 {
     try
     {
         UnionManager.Models.DomainModels.Role role = Find(entity.Id);
         db.Entry(role).State = System.Data.Entity.EntityState.Detached;
         db.Roles.Attach(entity);
         db.Entry(entity).State = System.Data.Entity.EntityState.Modified;
         if (autoSave)
         {
             bool result = Convert.ToBoolean(db.SaveChanges());
             return(result);
         }
         else
         {
             return(false);
         }
     }
     catch
     {
         return(false);
     }
 }