17.07.2015 Views

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

The Art of SQL Server FILESTREAM - Red Gate Software

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

Chapter 4: <strong>FILESTREAM</strong> with EntityFramework and LINQ to <strong>SQL</strong>In this chapter, we run through some labs that demonstrate how applications that employADO. NET Entity Framework (EF) or LINQ to <strong>SQL</strong> in their data access layer can interactwith the <strong>FILESTREAM</strong> feature.<strong>The</strong> focus will be on the <strong>FILESTREAM</strong> end <strong>of</strong> the equation, rather than on the specifics <strong>of</strong>the given data access framework or technology, and the chapter adopts a highly practicalapproach, consisting <strong>of</strong> the worked labs below.• Lab 2: Using <strong>FILESTREAM</strong> data with EF. This lab actually comprises twoseparate examples:• Lab 2a: a simple application that adopts the "default" EF approach <strong>of</strong> usingT-<strong>SQL</strong> to access the <strong>FILESTREAM</strong> data• Lab 2b: a custom approach that allows continued used <strong>of</strong> streaming I/O accesswith SqlFileStream.• Lab 3: Using <strong>FILESTREAM</strong> data with LINQ to <strong>SQL</strong>.As you can see, there is greater emphasis in this chapter on EF than on LINQ to <strong>SQL</strong>. <strong>The</strong>latter has been characterized by Micros<strong>of</strong>t as being for "strongly-typed LINQ access to <strong>SQL</strong><strong>Server</strong>, for rapidly developed applications" or, less formally by members <strong>of</strong> the Micros<strong>of</strong>tdeveloper community, as "the quick and dirty way to do it." In contrast, ADO.NET EntityFramework "provides strongly-typed LINQ access for applications requiring a more flexibleObject Relational mapping, across Micros<strong>of</strong>t <strong>SQL</strong> <strong>Server</strong> and third-party databases."131

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!