Beispiel #1
0
 public ControllerModelValues(ControllerModel inner)
 {
     if (inner != null)
     {
         ControllerName    = inner.ControllerName;
         ControllerType    = inner.ControllerType.AsType();
         ApiExplorer       = new ApiExplorerModelValues(inner.ApiExplorer);
         Actions           = inner.Actions.Select(a => new ActionModelValues(a)).ToList();
         Attributes        = inner.Attributes.Select(a => a.GetType()).ToList();
         Filters           = inner.Filters.Select(f => new FilterValues(f)).ToList();
         ActionConstraints = inner.ActionConstraints?.Select(a => new ActionConstraintValues(a))?.ToList();
         RouteConstraints  = inner.RouteConstraints.Select(
             r => new RouteConstraintProviderValues(r)).ToList();
         AttributeRoutes = inner.AttributeRoutes.Select(
             a => new AttributeRouteModelValues(a)).ToList();
     }
 }
 public ControllerModelValues(ControllerModel inner)
 {
     if (inner != null)
     {
         ControllerName = inner.ControllerName;
         ControllerType = inner.ControllerType.AsType();
         ApiExplorer = new ApiExplorerModelValues(inner.ApiExplorer);
         Actions = inner.Actions.Select(a => new ActionModelValues(a)).ToList();
         Attributes = inner.Attributes.Select(a => a.GetType()).ToList();
         ControllerProperties = inner.ControllerProperties.Select(p => new PropertyModelValues(p)).ToList();
         Filters = inner.Filters.Select(f => new FilterValues(f)).ToList();
         ActionConstraints = inner.ActionConstraints?.Select(a => new ActionConstraintValues(a))?.ToList();
         RouteConstraints = inner.RouteConstraints.Select(
             r => new RouteConstraintProviderValues(r)).ToList();
         AttributeRoutes = inner.AttributeRoutes.Select(
             a => new AttributeRouteModelValues(a)).ToList();
         Properties = new Dictionary<object, object>(inner.Properties);
     }
 }
Beispiel #3
0
 // note: omit the controller as this structure is nested inside the ControllerModelValues it belongs to
 public ActionModelValues(ActionModel inner)
 {
     if (inner != null)
     {
         ActionName       = inner.ActionName;
         ActionMethod     = inner.ActionMethod;
         ApiExplorer      = new ApiExplorerModelValues(inner.ApiExplorer);
         Parameters       = inner.Parameters.Select(p => new ParameterModelValues(p)).ToList();
         RouteConstraints = inner.RouteConstraints.Select(
             r => new RouteConstraintProviderValues(r)).ToList();
         Filters = inner.Filters.Select(f => new FilterValues(f)).ToList();
         if (inner.AttributeRouteModel != null)
         {
             AttributeRouteModel = new AttributeRouteModelValues(inner.AttributeRouteModel);
         }
         HttpMethods       = inner.HttpMethods;
         ActionConstraints = inner.ActionConstraints?.Select(a => new ActionConstraintValues(a))?.ToList();
     }
 }
 // note: omit the controller as this structure is nested inside the ControllerModelValues it belongs to
 public ActionModelValues(ActionModel inner)
 {
     if (inner != null)
     {
         ActionName = inner.ActionName;
         ActionMethod = inner.ActionMethod;
         ApiExplorer = new ApiExplorerModelValues(inner.ApiExplorer);
         Parameters = inner.Parameters.Select(p => new ParameterModelValues(p)).ToList();
         RouteConstraints = inner.RouteConstraints.Select(
             r => new RouteConstraintProviderValues(r)).ToList();
         Filters = inner.Filters.Select(f => new FilterValues(f)).ToList();
         if (inner.AttributeRouteModel != null)
         {
             AttributeRouteModel = new AttributeRouteModelValues(inner.AttributeRouteModel);
         }
         HttpMethods = inner.HttpMethods;
         ActionConstraints = inner.ActionConstraints?.Select(a => new ActionConstraintValues(a))?.ToList();
         Properties = new Dictionary<object, object>(inner.Properties);
     }
 }