hi,
I've a custom class created in c# which I need to fill from database multiple tables. for example, the class is something like below
public class Quotes
{
public string QuoteNumber { get; set; }
public DateTime EffectiveDate { get; set; }
public string Address { get; set; }
}
the sql query for this is
select quote.quoteid, policy.CoverStartDate, a.AddressLine1 + ',' + a.Postcode from quote
Inner Join policy on policy.QuoteId = quote.Quoteid
Inner Join BusinessDetails p on p.QuoteId = quote.QuoteId
Inner Join Address a on a.addressid = p.addressid
I want to write this query in LINQ......I tried the something like below,
QuoteEntity quote = new QuoteEntity(identities.QuoteID);
IEnumerable<Quotes> quotes = from q in quote
Join policy in policy
on quote.QuoteId equals policy.QuoteId
Join bd in BusinessDetails
on q.QuoteId equals bd.QuoteId
Join a in Address
on a.addressid equals bd.AddressId
select q.quoteid, policy.CoverStartDate, a.AddressLine1 + ',' + a.Postcode
Another thing that I tried to make it simple...
IEnumerable<QuoteEntity> qq = from q in quote select q;
this gives me error as "Could not find implmentation of query pattern for source type, select not found."
What's the problem?
Regards
Manish