Skip to content

SearchByGroups

alex-caroline edited this page Nov 9, 2018 · 4 revisions

Get All Published Foods in Group

var foodsByGroupRequest = new FoodsByGroupRequest
{
    GroupName = "Vegan Foods"
};
var foodsListResponse = foodQueryServiceClient.SearchByGroup(foodsByGroupRequest);

Get All Foods in Group

var foodsByGroupRequest = new FoodsByGroupRequest
{
    GroupName = "Vegan Foods",
    FilterByPublicationStates = new [] {PublicationState.Draft, PublicationState.Published }
};
var foodsListResponse = foodQueryServiceClient.SearchByGroup(foodsByGroupRequest);

Get All Recipes in Group

var foodsByGroupRequest = new FoodsByGroupRequest
{
    GroupName = "Vegan Foods",
    FilterByPublicationStates = new [] {PublicationState.Draft, PublicationState.Published },
    FilterByFoodTypes = new [] {FoodType.Recipe}
};
var foodsListResponse = foodQueryServiceClient.SearchByGroup(foodsByGroupRequest);

Get First 10 Recipes in Group

var foodsByGroupRequest = new FoodsByGroupRequest
{
    GroupName = "Vegan Foods",
    FilterByPublicationStates = new [] {PublicationState.Draft, PublicationState.Published },
    FilterByFoodTypes = new [] {FoodType.Recipe},
    StartIndex = 1,
    PageSize = 10
};
var foodsListResponse = foodQueryServiceClient.SearchByGroup(foodsByGroupRequest);

Get First 10 user created Recipes in Group

var foodsByGroupRequest = new FoodsByGroupRequest
{
    GroupName = "Vegan Foods",
    FilterByPublicationStates = new [] {PublicationState.Draft, PublicationState.Published },
    FilterByFoodTypes = new [] {FoodType.Recipe},
    DataSourceFilter = new [] {DataSources.UserFoods},
    StartIndex = 1,
    PageSize = 10
};
var foodsListResponse = foodQueryServiceClient.SearchByGroup(foodsByGroupRequest);