public async Task Get_Portal_Users_By_LocationId_Test() { var locationId = 118; IAsyncRepository <PortalUserAndLocationId> portalUserRepo = new PortalUserDataRepo(_iAgentDevDb); try { var portalUsers = await portalUserRepo.FindWithIdAsync(locationId); Assert.IsNotNull(portalUsers); var decryptPortalUsers = portalUsers.Select(p => new { locationId = p.Location_Id, portalId = p.Portal_Id, portalUserId = p.PortalUser_Id, password = p.Password.DecryptStringBase64(), username = p.Username.DecryptStringBase64(), isEnabled = p.IsEnabled, isExpired = p.IsExpired, allowsConcurrent = p.AllowsConcurrent }); foreach (var portalUser in decryptPortalUsers) { Console.WriteLine(portalUser); } } catch (SqlException) { throw; } }
private Task AddPortalUserWithLocationId(PortalUserAndLocationId portalUser, IDbConnection _iAgentDevDb) { IAsyncRepository <PortalUserAndLocationId> portalUserRepo = new PortalUserDataRepo(_iAgentDevDb); try { return(portalUserRepo.AddAsync(portalUser)); } catch (SqlException) { throw; } }