public ActionModel([NotNull] ActionModel other) { ActionMethod = other.ActionMethod; ActionName = other.ActionName; // Not making a deep copy of the controller, this action still belongs to the same controller. Controller = other.Controller; // These are just metadata, safe to create new collections ActionConstraints = new List <IActionConstraintMetadata>(other.ActionConstraints); Attributes = new List <object>(other.Attributes); Filters = new List <IFilter>(other.Filters); HttpMethods = new List <string>(other.HttpMethods); Properties = new Dictionary <object, object>(other.Properties); // Make a deep copy of other 'model' types. ApiExplorer = new ApiExplorerModel(other.ApiExplorer); Parameters = new List <ParameterModel>(other.Parameters.Select(p => new ParameterModel(p))); RouteConstraints = new List <IRouteConstraintProvider>(other.RouteConstraints); if (other.AttributeRouteModel != null) { AttributeRouteModel = new AttributeRouteModel(other.AttributeRouteModel); } }
public ControllerModel( TypeInfo controllerType, IReadOnlyList<object> attributes) { if (controllerType == null) { throw new ArgumentNullException(nameof(controllerType)); } if (attributes == null) { throw new ArgumentNullException(nameof(attributes)); } ControllerType = controllerType; Actions = new List<ActionModel>(); ApiExplorer = new ApiExplorerModel(); Attributes = new List<object>(attributes); AttributeRoutes = new List<AttributeRouteModel>(); ActionConstraints = new List<IActionConstraintMetadata>(); Filters = new List<IFilterMetadata>(); RouteConstraints = new List<IRouteConstraintProvider>(); Properties = new Dictionary<object, object>(); ControllerProperties = new List<PropertyModel>(); }
public ControllerModel(ControllerModel other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } ControllerName = other.ControllerName; ControllerType = other.ControllerType; // Still part of the same application Application = other.Application; // These are just metadata, safe to create new collections ActionConstraints = new List<IActionConstraintMetadata>(other.ActionConstraints); Attributes = new List<object>(other.Attributes); Filters = new List<IFilterMetadata>(other.Filters); RouteConstraints = new List<IRouteConstraintProvider>(other.RouteConstraints); Properties = new Dictionary<object, object>(other.Properties); // Make a deep copy of other 'model' types. Actions = new List<ActionModel>(other.Actions.Select(a => new ActionModel(a))); ApiExplorer = new ApiExplorerModel(other.ApiExplorer); AttributeRoutes = new List<AttributeRouteModel>( other.AttributeRoutes.Select(a => new AttributeRouteModel(a))); ControllerProperties = new List<PropertyModel>(other.ControllerProperties.Select(p => new PropertyModel(p))); }
public ActionModel( MethodInfo actionMethod, IReadOnlyList<object> attributes) { if (actionMethod == null) { throw new ArgumentNullException(nameof(actionMethod)); } if (attributes == null) { throw new ArgumentNullException(nameof(attributes)); } ActionMethod = actionMethod; ApiExplorer = new ApiExplorerModel(); Attributes = new List<object>(attributes); ActionConstraints = new List<IActionConstraintMetadata>(); Filters = new List<IFilterMetadata>(); HttpMethods = new List<string>(); Parameters = new List<ParameterModel>(); RouteConstraints = new List<IRouteConstraintProvider>(); Properties = new Dictionary<object, object>(); }
public ActionModel(ActionModel other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } ActionMethod = other.ActionMethod; ActionName = other.ActionName; // Not making a deep copy of the controller, this action still belongs to the same controller. Controller = other.Controller; // These are just metadata, safe to create new collections ActionConstraints = new List<IActionConstraintMetadata>(other.ActionConstraints); Attributes = new List<object>(other.Attributes); Filters = new List<IFilterMetadata>(other.Filters); HttpMethods = new List<string>(other.HttpMethods); Properties = new Dictionary<object, object>(other.Properties); // Make a deep copy of other 'model' types. ApiExplorer = new ApiExplorerModel(other.ApiExplorer); Parameters = new List<ParameterModel>(other.Parameters.Select(p => new ParameterModel(p))); RouteConstraints = new List<IRouteConstraintProvider>(other.RouteConstraints); if (other.AttributeRouteModel != null) { AttributeRouteModel = new AttributeRouteModel(other.AttributeRouteModel); } }
public ApplicationModel() { ApiExplorer = new ApiExplorerModel(); Controllers = new List<ControllerModel>(); Filters = new List<IFilter>(); Properties = new Dictionary<object, object>(); }
public ControllerModel(ControllerModel other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } ControllerName = other.ControllerName; ControllerType = other.ControllerType; // Still part of the same application Application = other.Application; // These are just metadata, safe to create new collections ActionConstraints = new List <IActionConstraintMetadata>(other.ActionConstraints); Attributes = new List <object>(other.Attributes); Filters = new List <IFilterMetadata>(other.Filters); RouteConstraints = new List <IRouteConstraintProvider>(other.RouteConstraints); Properties = new Dictionary <object, object>(other.Properties); // Make a deep copy of other 'model' types. Actions = new List <ActionModel>(other.Actions.Select(a => new ActionModel(a))); ApiExplorer = new ApiExplorerModel(other.ApiExplorer); AttributeRoutes = new List <AttributeRouteModel>( other.AttributeRoutes.Select(a => new AttributeRouteModel(a))); ControllerProperties = new List <PropertyModel>(other.ControllerProperties.Select(p => new PropertyModel(p))); }
public ControllerModel( TypeInfo controllerType, IReadOnlyList <object> attributes) { if (controllerType == null) { throw new ArgumentNullException(nameof(controllerType)); } if (attributes == null) { throw new ArgumentNullException(nameof(attributes)); } ControllerType = controllerType; Actions = new List <ActionModel>(); ApiExplorer = new ApiExplorerModel(); Attributes = new List <object>(attributes); AttributeRoutes = new List <AttributeRouteModel>(); ActionConstraints = new List <IActionConstraintMetadata>(); Filters = new List <IFilterMetadata>(); RouteConstraints = new List <IRouteConstraintProvider>(); Properties = new Dictionary <object, object>(); ControllerProperties = new List <PropertyModel>(); }
public ActionModel( MethodInfo actionMethod, IReadOnlyList <object> attributes) { if (actionMethod == null) { throw new ArgumentNullException(nameof(actionMethod)); } if (attributes == null) { throw new ArgumentNullException(nameof(attributes)); } ActionMethod = actionMethod; ApiExplorer = new ApiExplorerModel(); Attributes = new List <object>(attributes); ActionConstraints = new List <IActionConstraintMetadata>(); Filters = new List <IFilterMetadata>(); HttpMethods = new List <string>(); Parameters = new List <ParameterModel>(); RouteConstraints = new List <IRouteConstraintProvider>(); Properties = new Dictionary <object, object>(); }
public ApplicationModel() { ApiExplorer = new ApiExplorerModel(); Controllers = new List <ControllerModel>(); Filters = new List <IFilter>(); Properties = new Dictionary <object, object>(); }
public ApiExplorerModelValues(ApiExplorerModel inner) { if (inner != null) { IsVisible = inner.IsVisible; GroupName = inner.GroupName; } }
/// <summary> /// Creates a new <see cref="ApiExplorerModel"/> with properties copied from <paramref name="other"/>. /// </summary> /// <param name="other">The <see cref="ApiExplorerModel"/> to copy.</param> public ApiExplorerModel(ApiExplorerModel other) { if (other == null) { throw new ArgumentNullException(nameof(other)); } GroupName = other.GroupName; IsVisible = other.IsVisible; }
public ActionModel([NotNull] MethodInfo actionMethod, [NotNull] IReadOnlyList <object> attributes) { ActionMethod = actionMethod; ApiExplorer = new ApiExplorerModel(); Attributes = new List <object>(attributes); ActionConstraints = new List <IActionConstraintMetadata>(); Filters = new List <IFilter>(); HttpMethods = new List <string>(); Parameters = new List <ParameterModel>(); }
public ControllerModel([NotNull] TypeInfo controllerType, [NotNull] IReadOnlyList <object> attributes) { ControllerType = controllerType; Actions = new List <ActionModel>(); ApiExplorer = new ApiExplorerModel(); Attributes = new List <object>(attributes); AttributeRoutes = new List <AttributeRouteModel>(); ActionConstraints = new List <IActionConstraintMetadata>(); Filters = new List <IFilter>(); RouteConstraints = new List <IRouteConstraintProvider>(); }
public ActionModel([NotNull] MethodInfo actionMethod, [NotNull] IReadOnlyList<object> attributes) { ActionMethod = actionMethod; ApiExplorer = new ApiExplorerModel(); Attributes = new List<object>(attributes); ActionConstraints = new List<IActionConstraintMetadata>(); Filters = new List<IFilter>(); HttpMethods = new List<string>(); Parameters = new List<ParameterModel>(); RouteConstraints = new List<IRouteConstraintProvider>(); Properties = new Dictionary<object, object>(); }
public ControllerModel([NotNull] TypeInfo controllerType, [NotNull] IReadOnlyList<object> attributes) { ControllerType = controllerType; Actions = new List<ActionModel>(); ApiExplorer = new ApiExplorerModel(); Attributes = new List<object>(attributes); AttributeRoutes = new List<AttributeRouteModel>(); ActionConstraints = new List<IActionConstraintMetadata>(); Filters = new List<IFilter>(); RouteConstraints = new List<IRouteConstraintProvider>(); Properties = new Dictionary<object, object>(); ControllerProperties = new List<PropertyModel>(); }
public ControllerModel([NotNull] ControllerModel other) { ControllerName = other.ControllerName; ControllerType = other.ControllerType; // Still part of the same application Application = other.Application; // These are just metadata, safe to create new collections ActionConstraints = new List <IActionConstraintMetadata>(other.ActionConstraints); Attributes = new List <object>(other.Attributes); Filters = new List <IFilter>(other.Filters); RouteConstraints = new List <IRouteConstraintProvider>(other.RouteConstraints); // Make a deep copy of other 'model' types. Actions = new List <ActionModel>(other.Actions.Select(a => new ActionModel(a))); ApiExplorer = new ApiExplorerModel(other.ApiExplorer); AttributeRoutes = new List <AttributeRouteModel>( other.AttributeRoutes.Select(a => new AttributeRouteModel(a))); }
/// <summary> /// Creates a new <see cref="ApiExplorerModel"/> with properties copied from <paramref name="other"/>. /// </summary> /// <param name="other">The <see cref="ApiExplorerModel"/> to copy.</param> public ApiExplorerModel([NotNull] ApiExplorerModel other) { GroupName = other.GroupName; IsVisible = other.IsVisible; }