I’m working with self tracking entities on a n-tier application. So I have a WCF service which provides the client access to the data layer and I find myself implementing a lot of the “same” functions corresponding with Getting some entities from my model, for example GetOrders, and after changing them in the client, a Save(Order order) or Save(TrackableCollection<Orders> orders) operation to persist the changes.
I’m wondering if there exists a T4 template that could build the basic interface, with Get/Save for single and collections of each entity and the corresponding service implementation from my model?
I’m aware that I could write my own T4 Template to generate this service, and I will probably do just that if I have to, but first I thought I’d ask the community if this effort exists already somewhere on the internet, is planned, is desired by others and/or is a totally stupid idea.
I did find this WCF Data Services Generator example, which is kind of on the right track.
Maybe something more suited to STEs using WCF in an n-tier solution is out there?
There are out there (more), but you’ll always need to customise.
I’ve customised the simple templates found online, and in essence what it does is create the operation contracts, and web methods for visibility to win32 clients. Below is an excerpt: