Link to home
Start Free TrialLog in
Avatar of jazz__man
jazz__man

asked on

How can I convert IQueriable<T> to IQueriable<Contracts> ? Code example supplied (c#)

Hi,

How can I convert 'tempList ' below to IQueriable<Contract> ?

I have been trying all sorts of things but to no avail.

var tempList = (from Contract in dx.Contracts
                        join ac in dx.AppContracts on Contract.ContractId equals ac.ContractID
                        where ac.ApplicationID == appid
                        select new
                        {
                            ID = Contract.ContractId.ToString(),
                            Force = Contract.Force.Description,
                            Product = Contract.ParentApplication.Description,
                            Supplier = Contract.Supplier.SupplierName,
                            StartDate = string.Format("{0:dd/MM/yyyy}", (Contract.StartDate)),
                            EndDate = string.Format("{0:dd/MM/yyyy}", (Contract.EndDate)),
                            ITBMRef = Contract.ITBMRef,
                            Status = Contract.ContractStatus.ContractStatusDescription
                        });

Much Appreciated.
ASKER CERTIFIED SOLUTION
Avatar of kaufmed
kaufmed
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of jazz__man
jazz__man

ASKER

Brilliant!! Exactly what I needed. Thanks.