Table of Contents

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

route string

Base route of the API (e.g. "v1/products").

methods HttpMethod[]

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

string

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

bool

Methods

Supported HTTP methods (all if empty).

public HttpMethod[] Methods { get; }

Property Value

HttpMethod[]

Route

Base route of the API (e.g. "v1/products").

public string Route { get; }

Property Value

string