public IHttpActionResult SignIn(string login, string password) { if (string.IsNullOrWhiteSpace(login) || string.IsNullOrWhiteSpace(password)) { return(BadRequest("Please, enter login and password")); } else { User userId = UOperations.CheckUser(login, password); if (userId != null) { return(Ok(userId)); } else { return(BadRequest("Please, check correctness of login and password")); } } }
public IHttpActionResult SignIn(string login, string password) { if (string.IsNullOrWhiteSpace(login) || string.IsNullOrWhiteSpace(password)) { return(BadRequest("Please, enter login and password")); } else { User bll_user = UOperations.CheckUser(login, password); UserModel user = Mapper.Map <User, UserModel>(bll_user); if (user != null) { return(Ok(user)); } else { return(BadRequest("Please, check correctness of login and password")); } } }