c# - WCF Service Access in static class -


public static ienumerable<hospitalentities> getallhospitaldetails(hospitalrequest hospitalrequest) {     commonclass commonclass = new commonclass();     try     {         return mapper.map<ienumerable<hospitaldto>, list<hospitalentities>>(new healthserviceclient().getallhospitaldetails(new hospitalrequestdto         {             applicationcontext = mapper.map<applicationcontext, applicationcontextdto>(commonclass.applicationcontext),             tenantcontext = mapper.map<tenantcontext, tenantcontextdto>(commonclass.tenantcontext),             usercontext = mapper.map<usercontext, usercontextdto>(commonclass.usercontext),             selectedtenantid = hospitalrequest.selectedtenantid,             hospitaldto = mapper.map<hospitalentities, hospitaldto>(hospitalrequest.hospitals)         }).hospitalresponsedto);     }     catch (exception ex)     {         exceptionpolicy.handleexception(ex, exceptionpolicies.ui_policy, (int32)exceptionconstant.eventid.err_ui_health_healthservicehelper_getallhospitaldetails, "managevaccinationmaster.aspx", conversion.converttostring(commonclass.tenantcontext.tenantid), conversion.converttostring(commonclass.tenantcontext.clientcode), conversion.converttostring(commonclass.usercontext.userid));         throw ex;     } } 

is approach right? wcf connection remain opened? access wcf service static class?


Comments

Popular posts from this blog

javascript - Laravel datatable invalid JSON response -

java - Exception in thread "main" org.springframework.context.ApplicationContextException: Unable to start embedded container; -

sql server 2008 - My Sql Code Get An Error Of Msg 245, Level 16, State 1, Line 1 Conversion failed when converting the varchar value '8:45 AM' to data type int -