Author Archives: phil

ASP.NET MVC3 Using Code First Entity Framework Without Database Generation

Note that this works just as well with MVC4 as it does MVC3. So, when is Code First not Code First? It is possible, even recommended, to use ‘code first’ techniques even when you are not generating the database from … Continue reading

Posted in Entity Framework | Tagged , | Leave a comment

Extract the first N words from a string with C#

This code will return the first 5 words, change the number in the regular expression as needed:

Posted in RegEx | Tagged | Leave a comment

Streaming Files for more Secure Downloads in ASP.NET

If you just have a link to a file on your web site then you maybe leaving yourself open to other sites linking to the same files thereby giving their users the benefit of content without any hit on their … Continue reading

Posted in Security | Tagged | Leave a comment

Using the Entity Framework and the ObjectDataSource: Custom Paging

Readers maybe familiar with the Entity Framework (EF) tutorials on the asp.net web site (http://www.asp.net/entity-framework/tutorials). The latest addition to the series “Continuing with the Entity Framework” is an excellent tutorial on using version 4 of the Entity Framework in a … Continue reading

Posted in Entity Framework | Tagged | Leave a comment