public bool IsUser(UserProfile user)
 {
     UserProfile u = entity.UserProfiles.FirstOrDefault(x => x.Email.Equals(user.Email) && x.Password.Equals(user.Password));
     if (u == null)
         return false;
     return true;
 }
 public bool AddNew(UserProfile user)
 {
     try
     {
         entity.UserProfiles.Add(user);
         entity.SaveChanges();
     }
     catch (Exception e)
     {
         return false;
     }
     return true;
 }
 public bool UpdateProfile(UserProfile user)
 {
     try
     {
         entity.UserProfiles.AddOrUpdate(user);
         entity.SaveChanges();
     }
     catch (Exception e)
     {
         Console.Write(e.Message);
         return false;
     }
     return true;
 }