c# - Is it possible for a wcf service to take an SQLcommand object as an input? -
i'm asking because store command objects in appfabric cache , execute them @ later stage through batch once day. (to reduce number of uneven database hits). these pure update statements , don't return anything.
the short answer yes. wouldn't recommend doing it. instead pass query string , create sqlcommand in service.
this question explains how pass object client app wcf service; how pass client objects wcf service
basically if create sqlcommand object client side you're; 1) allocating/initializing object 2) having object serialized , deserialized equivalent object in service.
if pass string you're instead; 1) allocating/initializing string 2) passing service allocates , initializes sqlcommand object.
the latter simpler , more efficient.
Comments
Post a Comment