protected override IEnumerable <ServiceCompositeModel> FindSuitableModels(SPI.Model.CompositeModel compositeModel, SPI.Model.AbstractInjectableModel model, Attribute scope, Type targetType, Type serviceType) { return(LayeredApplicationModelUtils.SearchVisibleModels( sModel => sModel.ModelType.Equals(CompositeModelType.SERVICE) && sModel.PublicTypes.Any(pType => serviceType.IsAssignableFrom_IgnoreGenericArgumentsForGenericTypes(pType)), (moduleModel, cModel) => cModel, ((LayeredApplicationModel)compositeModel.ApplicationModel).FindModuleModel(compositeModel) ).Cast <ServiceCompositeModel>()); //var matchingModel = LayeredApplicationModelUtils.FindFirstVisibleCompositeModel( ( (LayeredApplicationModel) compositeModel.ApplicationModel ).FindModuleModel( compositeModel ), CompositeModelType.SERVICE, serviceType ); //return new ValidationResult( matchingModel != null, "The service of type " + serviceType + " is either not present or not visible." ); }
protected virtual Boolean ValidateNonStandardInjection(SPI.Model.CompositeModel compositeModel, SPI.Model.AbstractInjectableModel model, Attribute scope, Type targetType) { return(false); }
protected abstract IEnumerable <ServiceCompositeModel> FindSuitableModels(SPI.Model.CompositeModel compositeModel, SPI.Model.AbstractInjectableModel model, Attribute scope, Type targetType, Type serviceType);
protected override void PostValidateModel(SPI.Model.CompositeModel compositeModel, CompositeValidationResult validationResult) { // Nothing to do. }