c# - Service method with changing parameter -


i have service method:

public long insertmessage(outgoinginentity input) {     var request = new insertoutgoingmessagerequest     {        id = input.id        ... // fields     };     return util.usingwcfsync<ioutgoing, long>(client => client.insertoutgoing(request)); } 

i want reuse method in other context because want 1 method call specific service, parameter outgoinginentity can change. when call method other entities, fields used in insertoutgoingmessagerequest available , map did var request cannot initiate insertoutgoingmessagerequest in other context.

how can input parameter generic , can used kind of entities?

if want manage object receive can this:

public long insertmessage(object input) {    outgoinginentity yourobj = (outgoinginentity)input;    ///.. code ../// } 

then can same whatever need.


Comments

Popular posts from this blog

neo4j - finding mutual friends in a cypher statement starting with three or more persons -

php - How to remove letter in front of the word laravel -

minify - Minimizing css files -