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
Post a Comment