London Escorts sunderland escorts www.asyabahis.org www.dumanbet.live www.pinbahiscasino.com sekabet.net www.olabahisgir.com maltcasino.net faffbet-giris.com www.asyabahisgo1.com www.dumanbetyenigiris.com www.pinbahisgo1.com sekabet-giris2.com www.olabahisgo.com www.maltcasino-giris.com www.faffbet.net betforward1.org betforward.mobi 1xbet-adres.com 1xbet4iran.com romabet1.com www.yasbet2.net 1xirani.com www.romabet.top 3btforward1.com 1xbet https://1xbet-farsi4.com سایت شرط بندی معتبر betforward
Array

Building a List of Surveys to Synchronize with the Mobile Client

Must Read

Admin
Admin
Just post!

Whenever a user of the mobile client application initiates the synchronization process, the Tailspin Surveys service must build a list of new surveys that the user is interested in. The current version of the application uses the user’s list of preferred tenants to select the list of surveys, but Tailspin may expand the set of selection criteria in the future. The mobile client invokes the GetSurveys web method in SurveysService class to get a list of new surveys. The GetSurveys method uses the GetSurveysForUser method of the FilteringService class to get the list of surveys that it will return to the client.

The following code example shows how the FilteringService class gets the list of surveys for a user.

C#
private readonly ISurveyFilter[] filters;

public IEnumerable<Survey> GetSurveysForUser(
string username, DateTime fromDate)
{
return
(from filter in this.filters
from survey in filter.GetSurveys(username, fromDate)
select survey).Distinct(new SurveysComparer());
}

This method can use one or more ISurveyFilter objects to filter the list of surveys. The current version of the application uses a single filter named TenantFilter. The following code example shows the GetSurveys method of the TenantFilter class that first retrieves a list of tenants for the user, and then it retrieves a list of surveys for those tenants.

C#
public IEnumerable<Survey> GetSurveys(
string username, DateTime fromDate)
{
var tenants = this.tenantFilterStore.GetTenants(username);
if (tenants.Count() == 0)
{
tenants = this.tenantStore.GetTenants().Select(t =>
t.Name.ToLowerInvariant());
}
return
(from tenant in this.tenantFilterStore.GetTenants(username)
from survey in this.surveyStore.GetSurveys(
tenant, fromDate)
select survey).Distinct(new SurveysComparer());
}

- Advertisement -

Latest News

Bentley Unveils New Flying Spur: A 771 bhp Hybrid Supercar with Four Doors

Bentley Motors is set to revolutionize the luxury car market with the launch of its new Flying Spur on...
- Advertisement -

More Articles Like This

- Advertisement -