Ejemplo n.º 1
0
        private void AddContoller(ControllerFeature feature, ResourceBoundle resourceBoundle, Type controllerType)
        {
            var controllerGenericType = reflactionHelper.FillGenericType(controllerType, resourceBoundle);
            var hasDrivenContoller    = HasSameContoller(feature, controllerGenericType);

            if (!hasDrivenContoller)
            {
                feature.Controllers.Add(controllerGenericType.GetTypeInfo());
            }
        }
Ejemplo n.º 2
0
        public Type FillGenericType(Type genericType, ResourceBoundle resourceBoundle)
        {
            var genericArguments = GetGenericArguments(genericType, resourceBoundle).ToArray();

            return(genericType.MakeGenericType(genericArguments));
        }
Ejemplo n.º 3
0
 private IEnumerable <Type> GetGenericArguments(Type genericType, ResourceBoundle resourceBoundle)
 {
     return(genericType.GetGenericArguments()
            .Select(ga => resourceBoundle.GetTypeOf(ga.Name)));
 }