Ejemplo n.º 1
0
 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()));
        }
Ejemplo n.º 3
0
 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());
 }
Ejemplo n.º 4
0
 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());
 }
Ejemplo n.º 5
0
 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());
 }
Ejemplo n.º 6
0
        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
            });
        }
Ejemplo n.º 7
0
        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());
            }
        }
Ejemplo n.º 8
0
        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
            });
        }
Ejemplo n.º 9
0
 public Task <IEnumerable <LocationUser> > GetLocationsForUserAsync(string userId)
 {
     return(GetByFilterAsync(FilterOptions.Create(nameof(LocationUser.UserId), FilterOptions.Operators.Equals, userId)));
 }
Ejemplo n.º 10
0
 public Task <IEnumerable <DeploymentActivity> > GetRetryDeploymentActivitiesAsync()
 {
     return(GetByFilterAsync(FilterOptions.Create(nameof(DeploymentActivity.Status), FilterOptions.Operators.Equals, DeploymentActivityStatus.PendingRetry.ToString())));
 }
Ejemplo n.º 11
0
 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())));
 }
Ejemplo n.º 12
0
 public Task <IEnumerable <OrganizationAccount> > GetOrganizationsForAccountAsync(string accountId)
 {
     return(GetByFilterAsync(FilterOptions.Create("AccountId", FilterOptions.Operators.Equals, accountId)));
 }
Ejemplo n.º 13
0
 public Task <IEnumerable <LocationAccount> > GetLocationsForAccountAsync(string userId)
 {
     return(GetByFilterAsync(FilterOptions.Create("UserId", FilterOptions.Operators.Equals, userId)));
 }