public ActionResult <DataResult <LoginResponse> > Login([FromBody] LoginRequest loginReq) { var response = new DataResult <LoginResponse>(null) { Code = ResponseCode.BadRequest, Message = "unsuccessful" }; if (ModelState.IsValid) { var user = _userDataRepo.GetBy(x => x.EmailAddress == loginReq.EmailAddress && x.Password == loginReq.Password)?.FirstOrDefault(); #region dummyUserForAssesment if (user == null) { user = new User { FirstName = "murat", EmailAddress = "*****@*****.**", Id = new Guid().ToString() }; } #endregion if (user != null) { var token = TokenHelper.Authenticate(user); response.Code = ResponseCode.OK; response.Message = "Login successful. Api token was created."; response.Result = new LoginResponse { Token = token }; } else { response.Message = "User wasn't found"; } } return(response); }