SQL2012 new features – FileTable. Allow access to data in the form of files and folder. Also supports pagination –
SELECT * FROM abc order by name offset 5 rows fetch next 10 rows only
A database must be FILESTREAM enabled before you can create FileTables. There is a T-SQL you need to execute when you create the database.
The data will be saved in the [DIRECTORY_NAME] folder.
To create a table as a FILETABLE:
CREATE TABLE FT AS FILETABLE
Use TryParse to test casting operation before you use the value (Save to DB etc.)
Chapter 5 – LINQ
Difference between iEnumerable and iQueryable –
iEnumerable – the query (and filters) is executed in the memory;
iQUeryable – the query (and filters) is executed on the source. Good for data paging. Page 83
Write code to read data using the context
Behind the scenes, Linq to SQl use sqlmetal.exe to generate the mapping.
By default, when an entity is loaded with data, child entities are not populated. Called Lazy Loading – for performance reasons.
Querying WCF Data services
WCF DS allows you to expose your data as RESTFUL services using OData protocol.
Exercise: Querying NetFlix DB – no longer works.