public static ApiUser CreateUser(ApiUserRecord record) { return(new ApiUser() { Id = record.Id, Username = record.Username }); }
public async Task <ApiUser> Authenticate(string username, string password) { var user = await Task.Run(() => users.SingleOrDefault(x => x.Username == username && x.Password == password)); return((user == null) ? null : ApiUserRecord.CreateUser(user)); }