private void CreateErrorHandlers(IWebUtilityWrapper webUtilityWrapper) { var types = _reflection.GetTypesFromAssembly("Wizardsgroup.Core.Web"); var globalExceptionHandlers = _reflection.GetTypesWithImplementingInterface <IGlobalExceptionHandler>(types); _handlers = new List <IGlobalExceptionHandler>(); foreach (var handler in globalExceptionHandlers) { _handlers.Add(_reflection.CreateInstanceOfType <IGlobalExceptionHandler>(handler, webUtilityWrapper)); } }
private ILookupFunction _CreateInstanceOfLookUp(Type type) { ILookupFunction instance; try { instance = _helper.CreateInstanceOfType <ILookupFunction>(type, _unitOfWork); } catch (Exception) { instance = new NullCustomLookup(); } return(instance); }
public override IValidator CreateInstance(Type validatorType) { var typeInGenericArgs = validatorType.GetGenericArguments(); var validatorAttribute = (from type in typeInGenericArgs let attributeToCheck = type.GetCustomAttributes(typeof(ValidatorAttribute), true).FirstOrDefault() let validationAttr = attributeToCheck as ValidatorAttribute where validationAttr != null select validationAttr).FirstOrDefault(); if (validatorAttribute != null) { var validatorTypeToCreate = validatorAttribute.ValidatorType; var validatorInstance = _reflectionHelper.CreateInstanceOfType <IValidator>(validatorTypeToCreate, _unitOfWorkFunc); return(validatorInstance); } return(null); }
private IDataDictionarySeeder CreateIntanceOfDataDictionarySeeder(Type gridBuilder) { var seeders = _reflectionHelper.CreateInstanceOfType <IDataDictionarySeeder>(gridBuilder); return(seeders); }
private IHistoryInserter CreateIntanceOfHistoryInserter(Type historyInserterType, IContext context) { var historyInserter = _reflectionHelper.CreateInstanceOfType <IHistoryInserter>(historyInserterType, context); return(historyInserter); }
public ILookupValueField Create(Type type, string value, string id) { var lookUp = _helper.CreateInstanceOfType <ILookupValueField>(type, value, id); return(lookUp); }
private IBuildGridSchema CreateIntanceOfRuleType(Type gridBuilder) { var gridInstance = _reflectionHelper.CreateInstanceOfType <IBuildGridSchema>(gridBuilder); return(gridInstance); }