Jerry Nixon on Windows: EF4 Insert, Update, Delete in a WCF method

Jerry Nixon on Windows

Wednesday, June 30, 2010

EF4 Insert, Update, Delete in a WCF method

Once you have your models created and you are ready to save, the syntax is easy – once you know the syntax. And if you want to see how we do it, the code is [here].

6a00d8341bf6c153ef0115705c165b970c-800wi[1] So, we decided to use TT files to build this for us. We’re using the STE (Self-Tracking Entities) referenced in an outside assembly, and that seems to work just fine.

To be honest, I have been quite happy with the Entity Framework – including our decision to dump Data Services and stick to entity-specific CRUD methods on the service tier.

We also noticed that cascade logic seems to be plain-ole automatic. Even when cascades are not enabled within the SQL schema, they appear to work properly as an EF operation. Cool.

To the right, that Ted – and his “Street CRUD”: Create, Read, Update and Delete. My method sample is the CUD part.