In Entity Framework 5.0 spatial data types are supported so now we can create Linq queries to query nearby locations, calculate distances and check if locations intersect with an area. This articles demonstrates how to insert and update locations with latitude and longitude coordinates and how to query them in different ways.
- Setup of demo project
- Inserting and updating locations
- Calculating distances to a given location
- Calculating distances to a given route
- Locations that intersect with an area
Over the last few weeks I’ve been writing a series of articles that cover some great improvements in the Entity Framework 4.0 In this third article I will explore some SqlClr features and show how to call custom .NET functions and aggregates in LINQ to Entities queries.
- Creating SqlClr user defined functions
- Deploying SqlClr functions
- Calling the SqlClr functions in SQL
- Calling the SqlClr functions in LINQ to Entities
- Sharing functions between LINQ to Objects and LINQ to Entities
- Creating SqlClr User Defined aggregates
- Calling the SqlClr aggregates in SQL
- Calling the SqlClr aggregates in LINQ to Entities
In this second article about the Entity Framework version 4.0 user defined functions and the new Model Defined Functions will be explored.
Based on a series of simple examples I will show how to map UDF’s and Entity SQL expressions to Model Defined Functions and how to call them in LINQ to Entities queries.
- User Defined Functions (UDF)
- Creating custom functions in the storage model
- Model Defined Functions
The Entity Framework together with LINQ to Entities are very powerful technologies to access and manipulate data from a database. At first glance everyone is impressed by the conceptual layer which is mapped to tables in a database. When building large scale enterprise applications you will notice that the EF has a few shortcomings. When you need to gain performance or need extra security, stored procedures and user defined functions are often required. In this first article in a series of three I will focus on how to use stored procedures in the Entity Framework 4.0. In the second article I will demonstrate how to map user defined functions to model defined functions and to call them in LINQ to Entities queries. And in the final article SqlClr functions will be explored.
A few weeks ago Visual Studio 2010 & .NET 4.0 (CLR, BCL, WPF, WCF, EF, …) release candidates have been released. Last week during the MIX ’10 conference Silverlight 4 & WCF RIA Services v1 RC have been set online. Also a first community preview of Silverlight for Windows Phone 7 has been released. So it’s time to roundup all download locations and links to useful articles, blog posts, videos, samples, …
Visual Studio 2010
- Downloads: Microsoft Portal with download links for all Visual Studio editions (Professional, Premium & Ultimate), Team Foundation Server, SDK, Azure, …
- Article: Team Foundation Server 2010 Key Concepts
- Article: Team Foundation Server 2010: What’s new (Jakob Ehn)
- Article: What’s new for Database projects in VS 2010
- Article: What’s new in Code Analysis for Visual Studio 2010
- Blog: Into Visual Studio Team System (Pieter Gheysens)
- Blog: Visual Studio 2010 Profiler
- Article: What’s new in the Base Class Libraries in .NET 4.0 RC
- Article: What’s new in the Base Class Libraries in .NET 4.0 beta (Justin Van Patten)
- Article: Parallelism in .NET 4.0 (Reed Copsey)
Entity Framework 4.0
- Article: What’s new in WPF 4.0 (Scott Guthrie)
- Article: What’s new in WPF 4.0 beta 2 (Jaime Rodriguez)
- Article: What’s new in WCF 4.0 (Santosh Benjamin)
- Download: Windows Identity Foundation SDK
- Downloads: Silverlight 4.0, Blend 4.0 beta, WCF RIA Services
- Article: What’s new in Silverlight 4.0
- Article: What has changed in the Silverlight 4.0 RC (Tim Heuer)
- Blog: Silverlight 4.0 features (Mike Taulty)
- Article: WCF RIA Services road to RTW via RC (Dinesh Kulkarni)
- Videos: Silverlight 4 training courses
- Blog: WCF RIA Services (Brad Abrams)
Windows Phone Tools
A few weeks ago I started testing the beta version of LINQPad 1.35. Some days ago it has been officially released. This great tool from Joe Albahari was introduced in 2007 and nowadays it has become a very mature tool which should be in the toolbox of every .NET developer.
Version 1.35 offers new connection providers and it has native support for LINQ to SQL and the Entity Framework models. It also provides new query types like SQL and Entity-SQL.
I am a fan of this tool and I already demonstrated its features in many of my articles. I was probably one of the first developers who used LINQPad to execute LINQ to Entities queries. In the past you needed to add some references and create the ObjectContext in each script. It was a bit of work but it functioned fine. Now you can do the same thing with the new connection providers but they also offer many advantages. In a small article which can found on my website I will highlight some of the new features.