Dec 21, 2008, 2:24 PM
Best Practices for WebService CRUD operations
What is the best way to use webservices? I'm looking at the Examples folder ( Examples\GridPanel\Shared\SuppliersSaveWithConfirm ation.ashx.cs) among others.
I notice it uses SerializeableEntities for all CRUD operations. I use Linq to Sql for my data layer and I'm wondering if for real world apps where I either don't want all the columns for a table, or, I want to reference other entities that are not defined in LinqToSql, what is the best way to procede. I keep thinking linq to entities might be in my future, but it seems a little to soon from what I can tell. I'm wanting my web service to able to return something like an IQueryable as follows:
var query = from tbl in db.CampFeedTypes
select new
{
MyName = tbl.Name,
MyValue = tbl.id + "#"
};
It seems like I have to make an actual static entity out of each of my return types. is that true?The other area I'm concerned about is making more consistent updates. That is, I want to keep a special column in my table called something like LastUpdateTime, and then on the actual update, I want to read what that value was on my original read (not the read just before the update), but the one associated with the user looking at the data. I understands that means somehow I need to save that state. My apps general require that level of consitency checking.