/// <summary> /// Dummy, for testing DB connection. /// </summary> /// <returns></returns> public IHttpActionResult GetCreate() { string conString = "Server=10.108.233.52;" + "Initial Catalog=VortexDB;" + "User Id=sqladmin;" + "Password =Pa$$w0rd;"; using (DAL.UserRepository repo = new DAL.UserRepository(conString)) { repo.Create(UserConverter.ConvertFrom(users[0])); } return(Ok(users[2])); }
public IHttpActionResult Login(Models.User u) { bool validated = false; using (DAL.UserRepository repo = new DAL.UserRepository()) { validated = repo.AuthenticateUser(UserConverter.ConvertFrom(u)); } if (u.Username == "Martin") { return(Content((HttpStatusCode)418, u)); } if (validated) { return(Ok(validated)); } return(NotFound()); }