When I new a WCF service in my solution, can I do the following, have a constructor with parameter to pass in? If yes, how, when and where does the runtime fill in my required IBusinessLogic object?
[ServiceContract]
public interface IServiceContract
{
[OperationContract]
...
}
public class MyService : IServiceContract
{
IBusinessLogic _businessLogic;
public ServiceLayer(IBusinessLogic businessLogic)
{
_businessLogic = businessLogic;
}
...
}
question from:
https://stackoverflow.com/questions/381831/can-wcf-service-have-constructors 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…