protected override object GetInstance(Type serviceType, string key) { string contract = string.IsNullOrEmpty(key) ? AttributedModelServices.GetContractName(serviceType) : key; var exports = _container.GetExportedValues <object>(contract); if (exports.Any()) { return(exports.First()); } throw new Exception($"Could not locate any instances of contract {contract}."); }
protected override IEnumerable <object> GetAllInstances(Type serviceType) { return(_container.GetExportedValues <object>(AttributedModelServices.GetContractName(serviceType))); }