Пример #1
0
 public static ApiUser CreateUser(ApiUserRecord record)
 {
     return(new ApiUser()
     {
         Id = record.Id,
         Username = record.Username
     });
 }
Пример #2
0
        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));
        }