0

The project I am working on currently is connecting to and OData service to retrieve data from an Oracle database. Using LINQPad I can execute the query, and return the data that I'm expecting. The problem I am running into with LightSwitch is working with a composite key.

Here is the LINQ statement I am using:

from s in SYP_PROJECTS
where s.SYP_PRO_DISTNO == 5
where s.SYP_PRO_ITEMNO == Decimal.Parse("15.1")
select s

How can I use a LINQ statement against a datasource with Composite Keys, and pass in paraments from LightSwitch?

Entity

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Jason
  • 333
  • 1
  • 6
  • 17
  • 1
    Unlike forum sites, we don't use "Thanks", or "Any help appreciated", or signatures on [so]. See "[Should 'Hi', 'thanks,' taglines, and salutations be removed from posts?](http://meta.stackexchange.com/questions/2950/should-hi-thanks-taglines-and-salutations-be-removed-from-posts). – John Saunders Sep 17 '12 at 13:41

1 Answers1

0

The following code answered my original question

    partial void ReturnFromCode_PreprocessQuery(string DistrictNo, ref IQueryable<SYP_PROJECT> query)
    {
        query = (from myProjects in query
                 where myProjects.SYP_PRO_DISTNO == Int16.Parse(DistrictNo) 
                 //where myProjects.SYP_PRO_DISTNO == 5 && myProjects.SYP_PRO_ITEMNO == Decimal.Parse("15.1")
                 orderby myProjects.SYP_PRO_DISTNO descending
                 select myProjects);
    }
}
Jason
  • 333
  • 1
  • 6
  • 17