// 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); } }