public IFieldControlComponent Get(string fieldControlProviderName) { if (!_fieldControlComponents.Any()) { throw new AbpException("No field control component was registered! At least one component must be registered to be able to use the field customizing system."); } var fieldControlProvider = _fieldControlProviderSelector.Get(fieldControlProviderName); var fieldControlComponent = _fieldControlComponents.FirstOrDefault(fp => fp.FieldControlProviderType == fieldControlProvider.GetType()); if (fieldControlComponent == null) { throw new AbpException( $"Could not find the field control component with the field control provider type full name ({fieldControlProvider.GetType().FullName}) ." ); } else { return(fieldControlComponent); } }
public void Should_Select_Textbox_Form_Provider() { _selector.Get(TextboxFieldControlProvider.ProviderName).ShouldBeAssignableTo <TextboxFieldControlProvider>(); }