Class MagicalizedAttribute
- Namespace
- Magicalizer.Api.Dto.Abstractions
- Assembly
- Magicalizer.Api.Dto.Abstractions.dll
Marks a DTO that has the standard REST API.
[AttributeUsage(AttributeTargets.Class)]
public class MagicalizedAttribute : Attribute
- Inheritance
-
MagicalizedAttribute
- Inherited Members
Constructors
MagicalizedAttribute(string, params HttpMethod[])
Marks a DTO that has the standard REST API with the route and HTTP methods.
public MagicalizedAttribute(string route, params HttpMethod[] methods)
Parameters
routestringBase route of the API (e.g. "v1/products").
methodsHttpMethod[]Supported HTTP methods (all if empty).
Properties
GroupName
Group of the API in API description tools (e.g. the name of the OpenAPI document), as
ApiExplorerSettingsAttribute.GroupName of ASP.NET Core. The settings of a custom controller derived from
the magicalized ones win.
public string? GroupName { get; set; }
Property Value
IgnoreApi
Whether the API is hidden from API description tools (e.g. OpenAPI), as
ApiExplorerSettingsAttribute.IgnoreApi of ASP.NET Core does for a controller (the attribute can't be set on
a DTO, as DTOs don't depend on ASP.NET Core). The settings of a custom controller derived from the magicalized
ones win.
public bool IgnoreApi { get; set; }
Property Value
Methods
Supported HTTP methods (all if empty).
public HttpMethod[] Methods { get; }
Property Value
Route
Base route of the API (e.g. "v1/products").
public string Route { get; }