<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx</link><description>In this post Colin Meek and Diego Vega delve into some enhancements we are planning for LINQ to Entities, anyway over to them... Entity Framework v1 customers preferring to write their queries using LINQ often hit a limitation on the range of functions</description><dc:language>en-US</dc:language><generator>Telligent Evolution Platform Developer Build (Build: 5.6.50428.7875)</generator><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#10292967</link><pubDate>Thu, 12 Apr 2012 06:11:52 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:10292967</guid><dc:creator>bharat mali</dc:creator><description>&lt;p&gt;CREATE function [dbo].[DevanagariToInt](@Value nchar(10)) returns int&lt;/p&gt;
&lt;p&gt;begin&lt;/p&gt;
&lt;p&gt; &amp;nbsp;return cast(replace(replace(replace(replace(replace(replace(replace(replace(replace(replace(&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; @Value&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;०&amp;#39;, N&amp;#39;0&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;१&amp;#39;, N&amp;#39;1&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;२&amp;#39;, N&amp;#39;2&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;३&amp;#39;, N&amp;#39;3&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;४&amp;#39;, N&amp;#39;4&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;५&amp;#39;, N&amp;#39;5&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;६&amp;#39;, N&amp;#39;6&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;७&amp;#39;, N&amp;#39;7&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;८&amp;#39;, N&amp;#39;8&amp;#39;)&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; , N&amp;#39;९&amp;#39;, N&amp;#39;9&amp;#39;) as int)&lt;/p&gt;
&lt;p&gt;end&lt;/p&gt;
&lt;p&gt;This is my procedure and i want to use in entity framework&lt;/p&gt;
&lt;p&gt;i use in sql server in this way&lt;/p&gt;
&lt;p&gt;use Inventory1011&lt;/p&gt;
&lt;p&gt;go&lt;/p&gt;
&lt;p&gt;select dbo.DevanagariToInt(companycode) as exp from CompanyMaster order by exp&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=10292967" width="1" height="1"&gt;</description></item><item><title>Update on Computed Properties</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#9312722</link><pubDate>Tue, 13 Jan 2009 07:27:46 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9312722</guid><dc:creator>Entity Framework Design</dc:creator><description>&lt;p&gt;A while back I wrote a post that introduced the concept of Computed Properties . Since that time we’ve&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9312722" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#9302652</link><pubDate>Sat, 10 Jan 2009 00:08:54 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9302652</guid><dc:creator>aaa</dc:creator><description>&lt;p&gt;what about sprocs with table valued parameters? very useful for bulk-inserts!&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9302652" width="1" height="1"&gt;</description></item><item><title>Model Defined Functions</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#9301140</link><pubDate>Fri, 09 Jan 2009 04:55:38 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9301140</guid><dc:creator>Entity Framework Design</dc:creator><description>&lt;p&gt;Today the Entity Framework, and more specifically the Entity Data Model, have a limited notion of Functions.&lt;/p&gt;
&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9301140" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#9163823</link><pubDate>Tue, 02 Dec 2008 12:08:32 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9163823</guid><dc:creator>Alex Mineev (MSFT)</dc:creator><description>&lt;p&gt;Regarding the partially filled entities: you can define a function that will return entity refs instead of entities.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9163823" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#8996568</link><pubDate>Sun, 12 Oct 2008 11:25:59 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8996568</guid><dc:creator>Zeeshan Hirani</dc:creator><description>&lt;p&gt;Diego,&lt;/p&gt;
&lt;p&gt;Thanks for the explanation. For returning partially filled entity, the only reason i had was it was easier to pas it across tiers as compared to anonymous types. LIke for databainding scenaious, I had some stored procedures that would execute some complicated query to return few columns for my entity. When i was doing linq to sql i got away but as i moved my app over entity framework, I struggled through fixing my stored procedure to meet EF needs. &amp;nbsp;More so I would need somethings from extensions to be moved to core product that i use on a day to day basis on my project. Like I would create a stored procedure in the database and map it to any clr type entity or not it doesn't matter. There is so much pain that one has to go through to use a stored procedure and if the stored procedure does not map to an entity, you are out of luck.&lt;/p&gt;
&lt;p&gt;what else.. let me think &lt;/p&gt;
&lt;p&gt;More esql operatos needs to be supported in queryview.&lt;/p&gt;
&lt;p&gt;Be able t specify at the mapping level the default sort to be used in case there is no sort provided for associations or entitysets. LIke the other day I had the need to apply a sort everywhere I am retrieving orders for customers to be sorted by order date.&lt;/p&gt;
&lt;p&gt;Wilson ormapper supported this..&lt;/p&gt;
&lt;p&gt;flexible stored procedure mapping. I want to returning idenity column using output paramters. I can hack it by using command text but i dont like that option. my list is endless so i will stop.&lt;/p&gt;
&lt;p&gt;But thanks for listening to our needs. I am very happy that i moved my project to EF, my code is much cleaner &amp;nbsp;from the linq to sql queries because now my model is complicated but get a new developer started with our model is much easier and quicker.&lt;/p&gt;
&lt;p&gt;Thks&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8996568" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#8995726</link><pubDate>Sat, 11 Oct 2008 13:59:09 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8995726</guid><dc:creator>efdesign</dc:creator><description>&lt;p&gt;Stefan,&lt;/p&gt;
&lt;p&gt;At the language/CLR level, &amp;quot;extern&amp;quot; requires an implementation at type load time. What we are doing in this case does not really require any changes at lower levels of the framework. &lt;/p&gt;
&lt;p&gt;The idea of using this kind of &amp;quot;expression factory&amp;quot; method is interesting. It may result in code that is easier to read than building the expressions directly as we do. However, in the case of our internal code and generated code, the simpler expressions we get when we use the current way seem to be a better choice.&lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Diego&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8995726" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#8995709</link><pubDate>Sat, 11 Oct 2008 13:40:01 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8995709</guid><dc:creator>Diego Vega</dc:creator><description>&lt;p&gt;Zeeshan, &lt;/p&gt;
&lt;p&gt;I would like to understand more about the scenarios for &amp;quot;partially filled entities&amp;quot;. I not sure what is exactly possible and in which circumstances this is more useful than a projection. I am aware that we support materializing arbitrary classes and using ExecuteQuery and Translate in LINQ to SQL, and I agree that is a useful feature.&lt;/p&gt;
&lt;p&gt;I will follow up on your other question on query span iwth stored procedures with someone that may know the answer.&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8995709" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#8994005</link><pubDate>Fri, 10 Oct 2008 13:12:08 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8994005</guid><dc:creator>Stefan Dobrev</dc:creator><description>&lt;p&gt;The support seems promising. &lt;/p&gt;
&lt;p&gt;Here are 2 ideas I have in mind:&lt;/p&gt;
&lt;p&gt;1. For the static functions - can't we just declare them as extern without providing &amp;quot;dummy&amp;quot; implementation that throws exceptions.&lt;/p&gt;
&lt;p&gt;2. It is good to think about some kind of alternative syntax for Expression tree, because currently it seems a little bit ugly. Maybe some kind of expression tree's magic can do the trick: &lt;/p&gt;
&lt;p&gt;public static double? StandardDeviation( this IQueryable&amp;lt;int?&amp;gt; source )&lt;/p&gt;
&lt;p&gt;{&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;Expression ex = EntityExpression.Create( source.StandardDeviation() );&lt;/p&gt;
&lt;p&gt; &amp;nbsp; &amp;nbsp;return source.Provider.Execute&amp;lt;double?&amp;gt;( ex );&lt;/p&gt;
&lt;p&gt;}&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8994005" width="1" height="1"&gt;</description></item><item><title>re: EDM and Store functions exposed in LINQ</title><link>http://blogs.msdn.com/b/efdesign/archive/2008/10/08/edm-and-store-functions-exposed-in-linq.aspx#8993858</link><pubDate>Fri, 10 Oct 2008 10:26:42 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:8993858</guid><dc:creator>Zeeshan Hirani</dc:creator><description>&lt;p&gt;Thanks Diego for the explanation. I was looking for functions exposed to linq be also available for esql which u said it would be.&lt;/p&gt;
&lt;p&gt;Another question. Not sure if this is a right place to ask. Can we expect to retun partially filled entity cuz lot of times we do not need entire entity yet Ef requires a full entity set. Can the restriction be reduced to returning partially filled entity containing only entity key.&lt;/p&gt;
&lt;p&gt;Like in Linq to sql, I can return partially filled entity from stored procedure or dynamic sql as long as the reocrd set contains the column name that matches teh column name defined as the primary key on the entity.&lt;/p&gt;
&lt;p&gt;Also can we get relationship span to work with stored procedure as well?&lt;/p&gt;
&lt;div style="clear:both;"&gt;&lt;/div&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=8993858" width="1" height="1"&gt;</description></item></channel></rss>