c# - how to avoid in WCF service interface to implementing either synchronous or asynchronous Method -
i have implemented wcf services, have defined synchronize method following;
[servicecontract] public interface imarketingcampaigntype { [operationcontract] list<marketingcampaigntypedata> getallcampaigntypes(); [operationcontract] marketingcampaigntypedata getcampaigntypebyid(int campaigntypeid); [operationcontract] marketingcampaigntypedata createnewcampaigntype(); [operationcontract] marketingcampaigntypedata editcampaigntype(); [operationcontract] bool deletecampaigntype(); }
now on client side when configure service choosing 'add service reference' in visual studio under project, interface generated under namespace 'app.client.proxies.marketingcampaigntypeserviceref'
but when implement interface getting 2 of each methods each implementation 1 synchronous , other asynchronous. know in client choose 1 want implement question can can control 1 allowing or have 1 type of method instead of two?
here interface implementation of service
public class marketingcampaigntypeclient : imarketingcampaigntype { public marketingcampaigntypedata createnewcampaigntype() { throw new notimplementedexception(); } public task<marketingcampaigntypedata> createnewcampaigntypeasync() { throw new notimplementedexception(); } public bool deletecampaigntype() { throw new notimplementedexception(); } public task<bool> deletecampaigntypeasync() { throw new notimplementedexception(); } public marketingcampaigntypedata editcampaigntype() { throw new notimplementedexception(); } public task<marketingcampaigntypedata> editcampaigntypeasync() { throw new notimplementedexception(); } public marketingcampaigntypedata[] getallcampaigntypes() { throw new notimplementedexception(); } public task<marketingcampaigntypedata[]> getallcampaigntypesasync() { throw new notimplementedexception(); } public marketingcampaigntypedata getcampaigntypebyid(int campaigntypeid) { throw new notimplementedexception(); } public task<marketingcampaigntypedata> getcampaigntypebyidasync(int campaigntypeid) { throw new notimplementedexception(); }
Comments
Post a Comment