とにかく、これはエンティティフレームワークに関連する質問かもしれません。
次の単純なデータベーススキーマについて考えてみます。
CREATE TABLE Supplier(
SupplierId int identity(1,1) not null primary key,
DisplayName nvarchar(50)
)
CREATE TABLE Category(
CategoryId int identity(1,1) not null primary key,
DisplayName nvarchar(50)
)
CREATE TABLE Product(
ProductId int identity(1,1) not null primary key,
SupplierId int references Supplier.SupplierId,
CategoryId int references Category.CategoryId,
DisplayName nvarchar(50)
)
私が欲しいのは、サプライヤーとカテゴリーに基づいて製品をフィルタリングすることです。通常は、カテゴリIDとサプライヤIDを指定するだけですが、データベースをEFで公開しているため、DataServicesでは次のようなことはできません。
$filter=SupplierId eq 1 and CategoryId eq 2
これはかなり一般的なシナリオのように思われるので、可能である必要があります。しかし、どのように?