B
Ben
Hi, Thanks for reading the post. I would like to pass a search Entity
(for instance a "WorkerSearchEntity" that has several properties a
user can search on. Not necessarily all "search" properties will be
searched against. My question, is there a way to create a Linq to
Entity or Linq to SQL that will accept this "search" entity without
having to do something like below?
var query =
from order in orders
where order.OrderQty > 2 && order.OrderQty < 6 // don't want
to do this!
Would prefer something that I don't have to iterate through the entity
to determine which properties are not null... such as.. psuedocode...
where order = OrderSearchEntity;
Hoping that the code generator would handle the items such as...
where order.orderNumber = OrderSearchEntity.OrderNumber &&
order.orderDate = OrderSearchEntity.OrderDate
I appreciate any help on this. Thanks
(for instance a "WorkerSearchEntity" that has several properties a
user can search on. Not necessarily all "search" properties will be
searched against. My question, is there a way to create a Linq to
Entity or Linq to SQL that will accept this "search" entity without
having to do something like below?
var query =
from order in orders
where order.OrderQty > 2 && order.OrderQty < 6 // don't want
to do this!
Would prefer something that I don't have to iterate through the entity
to determine which properties are not null... such as.. psuedocode...
where order = OrderSearchEntity;
Hoping that the code generator would handle the items such as...
where order.orderNumber = OrderSearchEntity.OrderNumber &&
order.orderDate = OrderSearchEntity.OrderDate
I appreciate any help on this. Thanks