Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Now i work on similar issue. I have done next:</p> <ol> <li>Create next assemplities:</li> </ol> <p>SF.Contracts - that just defined ServiceCotnracts and DataContracts. Obvious all datacontracts may be used like POCO classes in EF (but i dont use t4 or other generator - all POCO classes and DataContext are written manualy, because i need to use very <a href="https://stackoverflow.com/questions/7886285/ef4-navigationproperty-and-join-is-a-bug-or-a-feature">bad database</a>). SF.</p> <p>SF.DataAccessObjects - in this assemlity i implement my edmx and DataContext. SF.Services - implementation of WCF Services.</p> <p>So, a large numbers of select WCF method have next signature and implementation:</p> <pre><code> public List&lt;Vulner&gt; VulnerSelect(int[] idList = null, string[] navigationPropertiesList = null) { var query = from vulner in _businessModel.DataModel.VulnerSet select vulner; if (navigationPropertiesList != null) navigationPropertiesList.Select(p =&gt;{query = ((ObjectQuery&lt;Vulner&gt;)query).Include(p); return true; }); if (idList != null) query = query.Where(p =&gt; idList.Contains(p.Id)); return query.ToList(); } </code></pre> <p>and you can use this method like this:</p> <pre><code>WCFproxy.VulnerSelect(new[]{1,2,3},new[]{"SecurityObjects", "SecurityObjrcts.Problem"}); </code></pre> <p>so that, you have no problem with serrialization, navigation properties etc. and you can clearly indicate which NavigationProperties must be load.</p> <p>p.s.: sory for my bad English :)</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload