【发布时间】:2017-05-19 14:12:54
【问题描述】:
如何在我的 Api 控制器中关闭我的 wcf 服务 我的 WCF 服务对象没有关闭方法!
程序正常运行。
private readonly ICarWebServices Service
public CarBookingApiController(ICarWebServices Service) // Injecting
{
this.Service = Service;
}
public IHttpActionResult GetAvaliableCars(string userId)
{
try
{
List<Cars> cars = Service.GetCars(userId).ToList();
// Service.Close() ??????????????????????
}
catch (Exception exception)
{
}
return Ok<List<Cars>>(cars);
}
【问题讨论】:
标签: c# asp.net-mvc wcf model-view-controller umbraco