Query Db from within a Linq Query - C# -


after "text" itemprop = "text">

I do a question on my XML file with Linq and when I parsed the data from the XML and received the data, I would go I can perform 2 calls as my snipet show against DB to fill 2 properties of my object needs, but I just need to make a call and 2 properties XDocument recentOrdersXDoc = GetResults (...) to get results to fill; Handle = c.Element ("handle") New ReturnResult (selection) {ClientTemplateID = (string) c.Element ("TemplateID") c, handle = resultref! = Zero? (String) resultref.Attribute ("handle"): Null, ClientID = DataContext.GetClientID (string) c.Element ("TemplateID"), CLIENTNAME = DataContext.GetClientName (string) c.Element ("TemplateID") ),};

To populate ClientID and to modify the date I need to call 2. There is a table called Client, which contains these 2 columns, ClientID and ClientName. Apart from this, when I need to pass it as an absolute in GetClientID and GetClientName, as in my code above, I need to end the result from XDocument. "Post-text" itemprop = "text">

How about something like this:

  var q = Recently in orderdeskdock. Decentendant ("prop") handle = c. Give the element ("handle") the customer template id = (string) c.Element ("TemplateID") client = DataContext.Clients. Where (x = & gt; x.ClientTemplateID == clientTemplateID). Select (x = & gt; new {x.ClientID, x.ClientName}). Single () New ReturnResult Selection () {clientTemplateID = clientTemplateID, handle = resultref! = Null? (String) resultref.Attribute ("handle"): Null, ClientID = client.ClientID, CLIENTNAME = client.ClientName};  

It still reads only two columns that you need (though, to name a few assumptions).


Comments

Popular posts from this blog

c++ - Linux and clipboard -

Visual Studio 2005: How to speed up builds when a VSMDI is open? -

booting ubuntu from usb using virtualbox -