Reputation: 3431
I have a simple select from a typed dataset:
var productlist = from prds in dsProducts.sk_products.AsEnumerable()
join prdcat in dsProducts.sk_productscategories.AsEnumerable() on prds.Field<int>("productid") equals prdcat.Field<int>("productid") where prdcat.Field<int>("categoryid") == categoryid
select prds;
Where productlist is set of records from the Dataset's sk_products datatable. I'd like to write a function to filter the records more, with a distinct on one of it's columns:
public List<string, string> GetDistinctManufacturerList(? productlist, int manufacturerid)
{
manufacturers = from prdz in productlist where prdz.Field<int>("manufacturerid") == manufacturerid select prdz; [...]
}
With what type of object should I refer to the variable productlist?
Upvotes: 2
Views: 406
Reputation: 46415
Its an IEnumberable<selected data type> - the selected data type could be an anonymous type, or in this case, will be your dataset type class.
Upvotes: 2
Reputation: 32094
I would guess something like IEnumerable<Product>
. And as ck says, Product is the name of your LINQ data class.
Upvotes: 1
Reputation: 31845
In your first example... mouse-over the word "var" in Visual studio, and it will display the "Type".
If it's something like 'anonymouse{blahblah}'... then you'll likely have to create a class that you want to convert it to so that you can use it as a function parameter.
Upvotes: 0