public ResponseEntity <Users> Login([FromBody] Users userdata) { var password = Encrypt(userdata.Password); userdata.Password = password; IEnumerable <Users> Checklogin = _accountRepository.FindByCondition(x => (x.Email == userdata.Email || x.Mobile == userdata.Mobile) && x.Password == userdata.Password); if (Checklogin != null && Checklogin.Count() > 0) { return(new ResponseEntity <Users> { Responsecode = 1, ResponseMessage = "Success", Entity = null, EnityList = Checklogin }); } else { return(new ResponseEntity <Users> { Responsecode = 0, ResponseMessage = "Invalid Login!", Entity = null, EnityList = Checklogin }); } }
public ResponseEntity <Users> GetbyID(string _id) { try { return(new ResponseEntity <Users> { Responsecode = 1, ResponseMessage = "Success!", Entity = null, EnityList = _accountRepository.FindByCondition(x => x._id == _id) }); } catch (Exception) { return(new ResponseEntity <Users> { Responsecode = 0, ResponseMessage = "Error during fetching records!", Entity = null, EnityList = null }); } }