예제 #1
0
        public ManaDbUser(ManaUser model)
        {
            if (model == null)
            {
                throw new ArgumentException(nameof(model));
            }

            Id           = model.Id;
            Email        = model.Email;
            PasswordHash = model.PasswordHash;
        }
예제 #2
0
 public async Task UpdateUser(ManaUser user)
 {
     try
     {
         using (var connection = await GetConnectionAsync())
         {
             await connection.ExecuteAsync(ManagementQueries.UserUpdate, user);
         }
     }
     catch (Exception e)
     {
         if (e is RecordNotFoundException)
         {
             throw;
         }
         throw new Exception("Could not update Mana User");
     }
 }
예제 #3
0
        public async Task <ManaUser> CreateUser(ManaUser user)
        {
            try
            {
                using (var connection = await GetConnectionAsync())
                {
                    var dbModel = new ManaDbUser(user);
                    await connection.ExecuteAsync(ManagementQueries.UserCreate, dbModel);

                    return(user);
                }
            }
            catch (Exception e)
            {
                if (e is RecordNotFoundException)
                {
                    throw;
                }
                throw new Exception("Could not get create Mana User");
            }
        }
예제 #4
0
 public SingleManaUserResponse(ManaUser user)
 {
     Id    = user.Id;
     Email = user.Email;
 }
예제 #5
0
 public ManaAuthUser(ManaUser user)
 {
     Id           = user.Id;
     Email        = user.Email;
     PasswordHash = user.PasswordHash;
 }