Tag Archives: .NET

ByTrent Jones

Entity Framework Code Only option

.NET 4.0 and VS 2010 introduce a new feature for the Entity Framework called model first.  In addition, you will now be able to have a code only model. Written with POCOs and a simple class derived from ObjectContext and you are on the way…


ByTrent Jones

Using Stored Procedures with Entity Framework

Yesterday i was attempting to use a stored procedure with the Entity Framework through the “function import” features and couldn’t get the auto-gen feature to expose the function on the Context.  The stored procedure was returning a scalar value which at this point doesn’t seem to be supported through auto-gen.  Choosing an Entity, however works fine. Further digging this morning led me to this article on the ADO.NET team blog explaining the issues with return types and stored procedures in Entity Framework.  The article also links to another great article showing how to return custom types two ways:  one way through the entity framework itself, the other through the use of extension methods.

ADO.NET Entity Framework Extensions

ByTrent Jones

Using T4 to Generate Stored Procs for Entity Framework

T4 code generation has been on my short list of things to look into but keeps getting put off as i navigate down some other endless path.  Meanwhile, I found a nice article on using T4 to generate stored procs for CRUD operations for the Entity Framework.

Entity Framework Stored Procedure Generation

Thanks David.

ByTrent Jones

Forms Authentication and Session Timeout

Ran into an issue on a website where the Session was timing out yet the forms auth ticket was still valid which was causing errors. Here is one solution:


The GU also mentions some of this in the post and in digging through all the comments.

ByTrent Jones

Membership, Roles and Profiles

Recently i’ve been researching the default providers in .NET for Membership, Roles and Profiles and came across this code which provides a custom implementation of the above with simple db structures behind them. http://altairiswebsecurity.codeplex.com/

ByTrent Jones

Plugin based development in .NET

Found a brief, useful example of how to implement a simple plug-in based application via .NET today on CodeProject.


ByTrent Jones

Configuration Section Designer

“A Visual Studio add-in that allows you to graphically design .NET Configuration Sections and automatically generates all the required code and a schema definition (XSD) for them.”


ByTrent Jones

WCF and Large File Transfers

I’ve been doing a bit of WCF lately and picked up on a few things that will be helpful for me to remember.  To speed large transfers switch the messageEncoding on the binding to be MTOM, otherwise your data will get base64 encoded inside the XML.

  1. Streaming requires a MessageContract and not a DataContract
  2. Streaming doesn’t work on wsHTTPbinding.
  3. A MessageContract can only have one Member in the body (stream).

Another good piece: