/// <summary> /// Get fact factory. /// </summary> /// <typeparam name="TFactRulesProvider"></typeparam> /// <param name="needNewFactory"></param> /// <returns></returns> public virtual GrFactFactory GetFactFactory <TFactRulesProvider>(bool needNewFactory = false) where TFactRulesProvider : GrFactRulesProviderBase, new() { if (_grFactFactory == null || needNewFactory || !_grFactFactory.IsRulesProvider <TFactRulesProvider>()) { _grFactFactory = CdiHelper.CreateFactFactory <TFactRulesProvider>(this); } return(_grFactFactory); }
/// <summary> /// Provider type check. /// </summary> /// <param name="factFactory"></param> /// <typeparam name="TRulesProvider"></typeparam> /// <returns></returns> public static bool IsRulesProvider <TRulesProvider>(this GrFactFactory factFactory) { return(factFactory._provider is TRulesProvider); }