示例#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;
 }