-->
SQL Clone
SQLServerCentral is supported by Redgate
 
Log in  ::  Register  ::  Not logged in
 
 
 

Gavin Draper's SQL Server Blog

Software Dev/DBA living the dream in sunny Brighton, UK. I've been playing with SQL Server about nearly 20 years now and still feel just as clueless as I did back then. I love writing about things I find as I go along.

Archives: January 2015

ASP.Net MVC File Stream, Initiated From Javascript Post

I was recently working on a page that does an AJAX post to an MVC controller passing quite a lot of parameters in the request. I needed to find a way to stream a file back to the browser as a result of a that Javascript call, for obvious reasons… Read more

0 comments, 23 reads

Posted in Gavin Draper's SQL Server Blog on 28 January 2015

Entity Framework 6 Interceptors

Interceptors in Entity Framework 6 allow you to hook in to before and after query events. The before events even allow you to modify the query that is about to be run. To write an interceptor you need to derive a class from DbCommandInterceptor and override the events you want… Read more

0 comments, 33 reads

Posted in Gavin Draper's SQL Server Blog on 27 January 2015

Entity Framework 6 Entity/Property To Table/Column Names

I was recently working on some code where I needed to be able to go from an EntitySet name to a table name and from an entity property name to a column name. It’s not something I’ve ever needed to do before so had to do some playing around with… Read more

0 comments, 30 reads

Posted in Gavin Draper's SQL Server Blog on 26 January 2015

Profiling Entity Framework 6 Queries

Entity Framework 6 introduced some API hooks that you can use to monitor log queries that Entity Framework is generating and running.

At it’s most basic level you can log EF calls by setting your DbContext Database.Log to an Action for example....

using System;
using System.Data.Entity;
using System.Linq;

namespace ConsoleApp…

Read more

0 comments, 66 reads

Posted in Gavin Draper's SQL Server Blog on 25 January 2015

F# Type Inference

I’m just starting to look at functional languages from an Object Oriented background. One of the first things I thought was quite cool is F#’s type inference model and the fact that parameters types on functions can be inferred.

Let’s take this C# code….

var myInt = 10

The C#… Read more

0 comments, 29 reads

Posted in Gavin Draper's SQL Server Blog on 23 January 2015