- updating to use Ardalis.Specifications package as it is maintained and has a more robust implementation - Removing all custom specification implementation - Updating unit tests
28 lines
886 B
C#
28 lines
886 B
C#
using Ardalis.Specification.QueryExtensions.Include;
|
|
using Microsoft.eShopWeb.UnitTests.ApplicationCore.Helpers.Query;
|
|
using System.Collections.Generic;
|
|
|
|
namespace Microsoft.eShopWeb.UnitTests.Builders
|
|
{
|
|
public class IncludeQueryBuilder
|
|
{
|
|
public IncludeQuery<Person, List<Person>> WithCollectionAsPreviousProperty()
|
|
{
|
|
var pathMap = new Dictionary<IIncludeQuery, string>();
|
|
var query = new IncludeQuery<Person, List<Person>>(pathMap);
|
|
pathMap[query] = nameof(Person.Friends);
|
|
|
|
return query;
|
|
}
|
|
|
|
public IncludeQuery<Book, Person> WithObjectAsPreviousProperty()
|
|
{
|
|
var pathMap = new Dictionary<IIncludeQuery, string>();
|
|
var query = new IncludeQuery<Book, Person>(pathMap);
|
|
pathMap[query] = nameof(Book.Author);
|
|
|
|
return query;
|
|
}
|
|
}
|
|
}
|