Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>Can you edit this in the dbml? Personally, I tend to treat the auto-generated types (from functions and stored procedures) as DTOs that are local to the DAL, so I immediately re-map them to my own POCO representation - i.e.</p> <pre><code>var qry = from row in ctx.SomeProc(12345) select new Foo {ID = row.ID, Name = row.Name }; </code></pre> <p>etc. Re the second question "Also, how can you perform a linq query on the result set of the stored procedure?" - I would recommend using a UDF instead of a stored procedure if you want to compose it: this allows you to do the composition at the database, for example paging and filtering:</p> <pre><code>var qry = (from row in ctx.SomeFunction(12345) where row.IsActive select row).Skip(10).Take(10); </code></pre> <p>which should (in LINQ-to-SQL at least) do everything in TSQL at the server. Otherwise, you can call <code>AsEnumerable()</code> and use LINQ-to-Objects at the calling .NET layer:</p> <pre><code>var qry = (from row in ctx.SomeProc(12345).AsEnumerable() where row.IsActive select row).Skip(10).Take(10); </code></pre> <hr> <p>To edit the dbml (which is just xml), change the <code>ElementType/@Name</code> here:</p> <pre><code>&lt;Function Name="dbo.CustOrderHist" Method="CustOrderHist"&gt; &lt;Parameter Name="CustomerID" Parameter="customerID" Type="System.String" DbType="NChar(5)" /&gt; &lt;ElementType Name="FooBar"&gt; &lt;!-- ********** HERE ************ --&gt; &lt;Column Name="ProductName" Type="System.String" DbType="NVarChar(40) NOT NULL" CanBeNull="false" /&gt; &lt;Column Name="Total" Type="System.Int32" DbType="Int" CanBeNull="true" /&gt; &lt;/ElementType&gt; &lt;/Function&gt; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

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