Back to Devexpress

WebApiDataServerHelper.AddKnownType(Type) Method

expressappframework-devexpress-dot-expressapp-dot-security-dot-clientserver-dot-webapi-dot-webapidataserverhelper-dot-addknowntype-x28-system-dot-type-x29.md

latest3.5 KB
Original Source

WebApiDataServerHelper.AddKnownType(Type) Method

Adds the specified custom permission request or custom logon parameter type to the ASP.NET Core Web API service known types list.

Namespace : DevExpress.ExpressApp.Security.ClientServer.WebApi

Assembly : DevExpress.ExpressApp.Security.v25.2.dll

NuGet Package : DevExpress.ExpressApp.Security

Declaration

csharp
public static void AddKnownType(
    Type type
)
vb
Public Shared Sub AddKnownType(
    type As Type
)

Parameters

NameTypeDescription
typeType

A type that this method adds to the ASP.NET Core Web API service known types list.

|

Remarks

In applications with Middle Tier Security, call this method on the server and client sides to register your custom permission requests and custom logon parameters. You do not need to use this method when you use standard logon parameters and do not have custom permission requests. Do not use this method to register business classes.

The AddKnownType method throws an InvalidOperationException if the WebApiDataServerHelper.GetKnownTypes method was already called internally. If you receive this exception, call this method earlier, before the data server and/or client application are initialized.

The following code snippet (auto-collected from DevExpress Examples) contains a reference to the AddKnownType(Type) method.

Note

The algorithm used to collect these code examples remains a work in progress. Accordingly, the links and snippets below may produce inaccurate results. If you encounter an issue with code examples below, please use the feedback form on this page to report the issue.

xaf-custom-logon-parameters/CS/EF/EFCoreCustomLogonAll.Win/Program.cs#L14

csharp
public static int Main(string[] args) {
    WebApiDataServerHelper.AddKnownType(typeof(CustomLogonParameters));

See Also

WebApiDataServerHelper Class

WebApiDataServerHelper Members

DevExpress.ExpressApp.Security.ClientServer.WebApi Namespace