//user for login public User CheckUserExits(String Email, String Password) { User UserDetails = new User(); try { UserDetails = _repository.CheckUserExits(Email, Password); } catch (System.Data.SqlClient.SqlException) { //network issue UserDetails.UserId = -1; return(UserDetails); } catch (Exception ex) { throw; } return(UserDetails); }