public async Task <bool> QueryOrganizationHasAccountByEmailAsync(string organizationId, string email) { return((await GetByFilterAsync( FilterOptions.Create("Email", FilterOptions.Operators.Equals, email.ToUpper()), FilterOptions.Create("OrganizationId", FilterOptions.Operators.Equals, organizationId) )).ToList().Any()); }
public async Task <IEnumerable <FirmwareDownloadRequest> > GetForDeviceAsync(string deviceRepoId, string deviceId) { var requests = await base.GetByFilterAsync(FilterOptions.Create(nameof(FirmwareDownloadRequestDTO.DeviceRepoId), FilterOptions.Operators.Equals, deviceRepoId), FilterOptions.Create(nameof(FirmwareDownloadRequestDTO.DeviceId), FilterOptions.Operators.Equals, deviceId)); return(requests.Select(rqst => rqst.ToDownloadRequest())); }
public async Task <Invitation> GetInviteByOrgIdAndEmailAsync(string orgId, string email) { return((await GetByFilterAsync( FilterOptions.Create(nameof(Invitation.Email), FilterOptions.Operators.Equals, email.ToUpper()), FilterOptions.Create(nameof(Invitation.OrganizationId), FilterOptions.Operators.Equals, orgId) )).FirstOrDefault()); }
public async Task <OrgUser> GetOrgUserAsync(string orgId, string userId) { return((await GetByFilterAsync( FilterOptions.Create(nameof(OrgUser.UserId), FilterOptions.Operators.Equals, userId.ToUpper()), FilterOptions.Create(nameof(OrgUser.PartitionKey), FilterOptions.Operators.Equals, orgId) )).FirstOrDefault()); }
public async Task <bool> QueryOrgHasUserByEmailAsync(string orgId, string email) { return((await GetByFilterAsync( FilterOptions.Create(nameof(OrgUser.Email), FilterOptions.Operators.Equals, email.ToUpper()), FilterOptions.Create(nameof(OrgUser.PartitionKey), FilterOptions.Operators.Equals, orgId) )).ToList().Any()); }
public async Task <IEnumerable <AssetSetSummary> > GetAssetSetsForManagedAssetAsync(string assetId) { var assetSets = await GetByFilterAsync(FilterOptions.Create(nameof(ManagedAsset.AssetId), FilterOptions.Operators.Equals, assetId)); return(from assetSet in assetSets select new AssetSetSummary() { Id = assetSet.AssetSetId, Name = assetSet.AssetSetName }); }
public async Task RemoveDeviceFromGroupAsync(DeviceRepository deviceRepo, string deviceGroupId, string deviceId) { SetConnection(deviceRepo.DeviceArchiveStorageSettings.AccountId, deviceRepo.DeviceArchiveStorageSettings.AccessKey); var result = await base.GetByFilterAsync(FilterOptions.Create("PartitionKey", FilterOptions.Operators.Equals, deviceGroupId), FilterOptions.Create("DeviceId", FilterOptions.Operators.Equals, deviceId)); if (result.Any()) { await base.RemoveAsync(result.First()); } }
public async Task <IEnumerable <TeamSummary> > GetMembersTeamsAsync(string userId) { var teams = await GetByFilterAsync(FilterOptions.Create(nameof(TeamUser.UserId), FilterOptions.Operators.Equals, userId)); return(from team in teams select new TeamSummary() { Id = team.TeamId, Name = team.TeamName }); }
public Task <IEnumerable <LocationUser> > GetLocationsForUserAsync(string userId) { return(GetByFilterAsync(FilterOptions.Create(nameof(LocationUser.UserId), FilterOptions.Operators.Equals, userId))); }
public Task <IEnumerable <DeploymentActivity> > GetRetryDeploymentActivitiesAsync() { return(GetByFilterAsync(FilterOptions.Create(nameof(DeploymentActivity.Status), FilterOptions.Operators.Equals, DeploymentActivityStatus.PendingRetry.ToString()))); }
public Task <IEnumerable <DeploymentActivity> > GetScheduledDeploymentActivitiesAsync() { return(GetByFilterAsync(FilterOptions.Create(nameof(DeploymentActivity.Status), FilterOptions.Operators.Equals, DeploymentActivityStatus.Scheduled.ToString()), FilterOptions.Create(nameof(DeploymentActivity.ScheduledFor), FilterOptions.Operators.LessThan, DateTime.UtcNow.ToJSONString()))); }
public Task <IEnumerable <OrganizationAccount> > GetOrganizationsForAccountAsync(string accountId) { return(GetByFilterAsync(FilterOptions.Create("AccountId", FilterOptions.Operators.Equals, accountId))); }
public Task <IEnumerable <LocationAccount> > GetLocationsForAccountAsync(string userId) { return(GetByFilterAsync(FilterOptions.Create("UserId", FilterOptions.Operators.Equals, userId))); }