Skip to content

Fast.Runtime public API

Targets: net8.0;net9.0;net10.0. This is a declaration and XML-comment reference. See the module guide for usage and constraints.

Source commit: 43554c07f6c216f80b509bd535c0a5b66ae7f2e8. Maintained through scripts/export-dotnet-api.ps1 -Language en; ordinary site builds consume this file directly.

System.ApiInfoAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Method)]
public class ApiInfoAttribute : Attribute

API information

System.ApiInfoAttribute.Name

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Name { get; set; }

API name

System.ApiInfoAttribute.Action

Source · Targets: net8.0, net9.0, net10.0

csharp
public HttpRequestActionEnum Action { get; set; }

Operation kind

System.ApiInfoAttribute.ApiInfoAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public ApiInfoAttribute(string name)

API information

  • Parameter name: API name

System.ApiInfoAttribute.ApiInfoAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public ApiInfoAttribute(string name, HttpRequestActionEnum action)

API information

  • Parameter name: API name
  • Parameter action: HttpRequestActionEnum operation kind

System.FastEnumAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Enum)]
public class FastEnumAttribute : Attribute

Enum attribute

Remarks: Identifies whether an enum can be written to the enum dictionary

System.FastEnumAttribute.ChName

Source · Targets: net8.0, net9.0, net10.0

csharp
public string ChName { get; set; }

Chinese name

System.FastEnumAttribute.EnName

Source · Targets: net8.0, net9.0, net10.0

csharp
public string EnName { get; set; }

English name

System.FastEnumAttribute.Remark

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Remark { get; set; }

Remarks

System.FastEnumAttribute.FastEnumAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public FastEnumAttribute()

Enum attribute

Remarks: Identifies whether an enum can be written to the enum dictionary

System.FastEnumAttribute.FastEnumAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public FastEnumAttribute(string chName, string enName, string remark)

Enum attribute

Remarks: Identifies whether an enum can be written to the enum dictionary

  • Parameter chName: Chinese display name
  • Parameter enName: English display name
  • Parameter remark: Additional notes

System.FastEnumAttribute.FastEnumAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public FastEnumAttribute(string chName, string enName)

Enum attribute

Remarks: Identifies whether an enum can be written to the enum dictionary

  • Parameter chName: Chinese display name
  • Parameter enName: English display name

System.FastEnumAttribute.FastEnumAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public FastEnumAttribute(string chName)

Enum attribute

Remarks: Identifies whether an enum can be written to the enum dictionary

  • Parameter chName: Chinese display name

System.MapHubAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Class, AllowMultiple = true)]
public class MapHubAttribute : Attribute

Hub configuration attribute

System.MapHubAttribute.Pattern

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Pattern { get; set; }

Configures the endpoint route

System.MapHubAttribute.MapHubAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
public MapHubAttribute(string pattern)

Initializes a new instance of the class

  • Parameter pattern: Pattern used to match target entries

System.SuppressSnifferAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Class
                | AttributeTargets.Interface
                | AttributeTargets.Method
                | AttributeTargets.Enum
                | AttributeTargets.Struct)]
public class SuppressSnifferAttribute : Attribute

Attribute excluding an item from scanning and discovery

Remarks: Used when scanning assembly types or methods

System.ComponentModel.DataAnnotations.DateTimeRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class DateTimeRequiredAttribute : ValidationAttribute

Validates a required DateTime property

Remarks: Must be between 1949-10-01 and 2099-12-31 by default

System.ComponentModel.DataAnnotations.DateTimeRequiredAttribute.MinValue

Source · Targets: net8.0, net9.0, net10.0

csharp
public DateTime MinValue { get; set; } = new(1949, 10, 01, 00, 00, 00);

Minimum value

System.ComponentModel.DataAnnotations.DateTimeRequiredAttribute.MaxValue

Source · Targets: net8.0, net9.0, net10.0

csharp
public DateTime MaxValue { get; set; } = new(2099, 12, 31, 23, 59, 59);

Maximum value

System.ComponentModel.DataAnnotations.DateTimeRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.DecimalRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class DecimalRequiredAttribute : ValidationAttribute

Validates a required decimal property

System.ComponentModel.DataAnnotations.DecimalRequiredAttribute.AllowZero

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowZero { get; set; } = true;

Allow zero

System.ComponentModel.DataAnnotations.DecimalRequiredAttribute.AllowNegative

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowNegative { get; set; } = false;

Allow negative numbers

System.ComponentModel.DataAnnotations.DecimalRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.DoubleRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class DoubleRequiredAttribute : ValidationAttribute

Validates a required double property

System.ComponentModel.DataAnnotations.DoubleRequiredAttribute.AllowZero

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowZero { get; set; } = true;

Allow zero

System.ComponentModel.DataAnnotations.DoubleRequiredAttribute.AllowNegative

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowNegative { get; set; } = false;

Allow negative numbers

System.ComponentModel.DataAnnotations.DoubleRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.EnumRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class EnumRequiredAttribute : ValidationAttribute

Validates a required Enum property

Remarks: By default, checks whether the current value belongs to the enum; implement other validation separately

System.ComponentModel.DataAnnotations.EnumRequiredAttribute.AllowZero

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowZero { get; set; } = false;

Allow zero

Remarks: Commonly used when the default enum value is None = 0 but selecting it is prohibited

System.ComponentModel.DataAnnotations.EnumRequiredAttribute.FlagEnum

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool FlagEnum { get; set; } = false;

Flags enum

System.ComponentModel.DataAnnotations.EnumRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.FloatRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class FloatRequiredAttribute : ValidationAttribute

Validates a required float property

System.ComponentModel.DataAnnotations.FloatRequiredAttribute.AllowZero

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowZero { get; set; } = true;

Allow zero

System.ComponentModel.DataAnnotations.FloatRequiredAttribute.AllowNegative

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowNegative { get; set; } = false;

Allow negative numbers

System.ComponentModel.DataAnnotations.FloatRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.IntRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class IntRequiredAttribute : ValidationAttribute

Validates a required int property

System.ComponentModel.DataAnnotations.IntRequiredAttribute.AllowZero

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowZero { get; set; } = false;

Allow zero

System.ComponentModel.DataAnnotations.IntRequiredAttribute.AllowNegative

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowNegative { get; set; } = false;

Allow negative numbers

System.ComponentModel.DataAnnotations.IntRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.LongRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class LongRequiredAttribute : ValidationAttribute

Validates a required long property

System.ComponentModel.DataAnnotations.LongRequiredAttribute.AllowZero

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowZero { get; set; } = false;

Allow zero

System.ComponentModel.DataAnnotations.LongRequiredAttribute.AllowNegative

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowNegative { get; set; } = false;

Allow negative numbers

System.ComponentModel.DataAnnotations.LongRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

System.ComponentModel.DataAnnotations.StringRequiredAttribute

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
[AttributeUsage(AttributeTargets.Property | AttributeTargets.Field | AttributeTargets.Parameter)]
public class StringRequiredAttribute : ValidationAttribute

Validates a required string property

System.ComponentModel.DataAnnotations.StringRequiredAttribute.AllowEmptyString

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowEmptyString { get; set; } = false;

Allow empty strings

System.ComponentModel.DataAnnotations.StringRequiredAttribute.AllowWhitespace

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool AllowWhitespace { get; set; } = true;

Allow leading and trailing spaces

System.ComponentModel.DataAnnotations.StringRequiredAttribute.IsValid

Source · Targets: net8.0, net9.0, net10.0

csharp
public override bool IsValid(object value)

Documentation is inherited from an interface or base class; consult that declaration.

Fast.Runtime.UserAgentInfo

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public class UserAgentInfo

User-agent information

Fast.Runtime.UserAgentInfo.Device

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Device { get; set; }

Device

Fast.Runtime.UserAgentInfo.OS

Source · Targets: net8.0, net9.0, net10.0

csharp
public string OS { get; set; }

Operating system and version

Fast.Runtime.UserAgentInfo.Browser

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Browser { get; set; }

Browser and version

Fast.Runtime.WanNetIPInfo

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public class WanNetIPInfo

Public IP information

Fast.Runtime.WanNetIPInfo.Ip

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Ip { get; set; }

IP address

Fast.Runtime.WanNetIPInfo.Province

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Province { get; set; }

Province

Fast.Runtime.WanNetIPInfo.ProvinceZipCode

Source · Targets: net8.0, net9.0, net10.0

csharp
public string ProvinceZipCode { get; set; }

Province postal code

Fast.Runtime.WanNetIPInfo.City

Source · Targets: net8.0, net9.0, net10.0

csharp
public string City { get; set; }

City

Fast.Runtime.WanNetIPInfo.CityZipCode

Source · Targets: net8.0, net9.0, net10.0

csharp
public string CityZipCode { get; set; }

City postal code

Fast.Runtime.WanNetIPInfo.Address

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Address { get; set; }

Geographic information

Fast.Runtime.WanNetIPInfo.Operator

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Operator { get; }

Network operator

Fast.Runtime.ConsoleWriter

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public sealed class ConsoleWriter

Color and text output context for synchronous console-write callbacks

Remarks: Use only inside the current write callback; color settings are ignored when output is redirected

Fast.Runtime.ConsoleWriter.ForegroundColor

Source · Targets: net8.0, net9.0, net10.0

csharp
public ConsoleColor ForegroundColor { get; set; }

Current console foreground color; setting it has no effect when output is redirected

Fast.Runtime.ConsoleWriter.BackgroundColor

Source · Targets: net8.0, net9.0, net10.0

csharp
public ConsoleColor BackgroundColor { get; set; }

Current console background color; setting it has no effect when output is redirected

Fast.Runtime.ConsoleWriter.Write

Source · Targets: net8.0, net9.0, net10.0

csharp
public void Write(string value)

Writes text without appending a newline

  • Parameter value: Text to write; writes nothing when null

Fast.Runtime.ConsoleWriter.Write

Source · Targets: net8.0, net9.0, net10.0

csharp
public void Write(object value)

Writes an object's text representation without appending a newline

  • Parameter value: Object to write; writes nothing when null

Fast.Runtime.ConsoleWriter.WriteLine

Source · Targets: net8.0, net9.0, net10.0

csharp
public void WriteLine()

Writes a newline

Fast.Runtime.ConsoleWriter.WriteLine

Source · Targets: net8.0, net9.0, net10.0

csharp
public void WriteLine(string value)

Writes text followed by a newline

  • Parameter value: Text to write; writes only a newline when null

Fast.Runtime.ConsoleWriter.WriteLine

Source · Targets: net8.0, net9.0, net10.0

csharp
public void WriteLine(object value)

Writes an object's text representation followed by a newline

  • Parameter value: Object to write; writes only a newline when null

Fast.Runtime.ConsoleWriter.ResetColor

Source · Targets: net8.0, net9.0, net10.0

csharp
public void ResetColor()

Restores the foreground and background colors present when the current write callback began

System.MAppContext

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class MAppContext

Microsoft App context

System.MAppContext.AssemblyVersion

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly string AssemblyVersion;

Entry assembly version

System.MAppContext.RuntimeLibraries

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly IEnumerable<DependencyLibrary> RuntimeLibraries;

Application runtime libraries

System.MAppContext.Assemblies

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly IEnumerable<Assembly> Assemblies;

Effective application assemblies

System.MAppContext.ProjectAssemblies

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly IEnumerable<Assembly> ProjectAssemblies;

Effective assemblies from locally referenced projects

System.MAppContext.Types

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly IEnumerable<Type> Types;

Types from effective assemblies

Remarks: All public types

System.MAppContext.EffectiveTypes

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly IEnumerable<Type> EffectiveTypes;

Types from effective assemblies

Remarks: Excludes types decorated with SuppressSnifferAttribute

System.MAppContext.ProjectEffectiveTypes

Source · Targets: net8.0, net9.0, net10.0

csharp
public static readonly IEnumerable<Type> ProjectEffectiveTypes;

Types from effective locally referenced project assemblies

Remarks: Excludes types decorated with SuppressSnifferAttribute

System.MAppContext.UnmanagedObjects

Source · Targets: net8.0, net9.0, net10.0

csharp
public static ConcurrentBag<IDisposable> UnmanagedObjects { get; private set; }

Collection of unmanaged objects

System.MAppContext.ConsoleWrite

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void ConsoleWrite(Action<ConsoleWriter> action)

Synchronously writes to the console and automatically restores the original foreground and background colors

  • Parameter action: Synchronous callback using the color and text output context

Remarks: Write callbacks on the same output stream run serially. Original colors are restored whether the callback completes or throws. Redirected output ignores colors and writes text only; callback exceptions propagate to the caller

  • Throws ArgumentNullException: action is null

System.MAppContext.CatchOrDefault

Source · Targets: net8.0, net9.0, net10.0

csharp
public static T CatchOrDefault<T>(Func<T> action, T defaultValue = null) where T : class

Handles exceptions while retrieving an object

  • Parameter action: Operation delegate to execute
  • Parameter defaultValue: Default value used when the operation cannot produce a result
  • Type parameter T: Reference type returned by the operation
  • Returns: Handles exceptions while retrieving an object

System.MAppContext.GetOptionName

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string GetOptionName<TOptions>() where TOptions : class, new()

Gets the options name

  • Type parameter TOptions: Configuration options type
  • Returns: Retrieved options name

System.MAppContext.GetServiceProvider

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IServiceProvider GetServiceProvider(Type serviceType, IServiceProvider rootServices,
        IServiceCollection internalServices, HttpContext httpContext)

Resolves the service provider

  • Parameter serviceType: Service type to look up
  • Parameter rootServices: Application root service provider
  • Parameter internalServices: Service collection used internally by the framework
  • Parameter httpContext: Current request context
  • Returns: Resolved service provider

System.MAppContext.GetCurrentStartupUri

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Uri GetCurrentStartupUri(IServer server)

Gets the current application's startup URI

Remarks: Returns the first address by default and may be empty; do not use during application startup

  • Parameter server: Target service instance
  • Returns: Current application's startup URI

System.MAppContext.GetThreadId

Source · Targets: net8.0, net9.0, net10.0

csharp
public static int GetThreadId()

Gets the current thread ID

  • Returns: Current thread ID

System.MAppContext.GetTraceId

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string GetTraceId(IServiceProvider rootServices, HttpContext httpContext)

Gets the current request's TraceId

  • Parameter rootServices: Application root service provider
  • Parameter httpContext: Current request context
  • Returns: Current request's TraceId

System.MAppContext.GetExecutionTime

Source · Targets: net8.0, net9.0, net10.0

csharp
public static long GetExecutionTime(Action action)

Measures execution time for a block of code

  • Parameter action: Operation delegate to execute
  • Returns: Measured code execution time

System.MAppContext.AddUnmanagedObjects

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void AddUnmanagedObjects(IDisposable dsp)

Adds an unmanaged object

  • Parameter dsp: Service provider used to resolve dynamic services
  • Throws ArgumentNullException: dsp is null

System.MAppContext.DisposeUnmanagedObjects

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void DisposeUnmanagedObjects()

Disposes all unmanaged objects

System.Debugging

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class Debugging

Writes event information to the event manager

System.Debugging.WriteLine

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void WriteLine(int level, string message)

Writes one line of event information

  • Parameter level: Information levels: trace, information, warning, error, file, tip, search, and clock
  • Parameter message: Message to record or return

System.Debugging.WriteLine

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void WriteLine(int level, string message, params object[] args)

Writes one line of event information

  • Parameter level: Information levels: trace, information, warning, error, file, tip, search, and clock
  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.Trace

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace(string message)

Writes a trace event

  • Parameter message: Message to record or return

System.Debugging.Trace

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Trace(string message, params object[] args)

Writes a trace event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.Info

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Info(string message)

Writes an information event

  • Parameter message: Message to record or return

System.Debugging.Info

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Info(string message, params object[] args)

Writes an information event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.Warn

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warn(string message)

Writes a warning event

  • Parameter message: Message to record or return

System.Debugging.Warn

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Warn(string message, params object[] args)

Writes a warning event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.Error

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error(string message)

Writes an error event

  • Parameter message: Message to record or return

System.Debugging.Error

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Error(string message, params object[] args)

Writes an error event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.File

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void File(string message)

Writes a file event

  • Parameter message: Message to record or return

System.Debugging.File

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void File(string message, params object[] args)

Writes a file event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.Tip

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Tip(string message)

Writes a tip event

  • Parameter message: Message to record or return

System.Debugging.Tip

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Tip(string message, params object[] args)

Writes a tip event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Search(string message)

Writes a search event

  • Parameter message: Message to record or return

System.Debugging.Search

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Search(string message, params object[] args)

Writes a search event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.Clock

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Clock(string message)

Writes a clock event

  • Parameter message: Message to record or return

System.Debugging.Clock

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void Clock(string message, params object[] args)

Writes a clock event

  • Parameter message: Message to record or return
  • Parameter args: Arguments used to format the message

System.Debugging.GetLevelEmoji

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string GetLevelEmoji(int level)

Gets the emoji for an information level

  • Parameter level: Log level
  • Returns: Emoji for the information level

System.AppEnvironmentEnum

Source · Targets: net8.0, net9.0, net10.0

csharp
[Flags]
[FastEnum("App运行环境枚举")]
public enum AppEnvironmentEnum : long

Application runtime environment enum

System.AppEnvironmentEnum.Web

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Web")]
    Web = 1

Web

System.AppEnvironmentEnum.Windows

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Windows")]
    Windows = 2

Windows

System.AppEnvironmentEnum.Mac

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Mac")]
    Mac = 4

Mac

System.AppEnvironmentEnum.Linux

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Linux")]
    Linux = 8

Linux

System.AppEnvironmentEnum.Android

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Android")]
    Android = 32

Android

System.AppEnvironmentEnum.IOS

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("IOS")]
    IOS = 64

IOS

System.AppEnvironmentEnum.QuickApp

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("快应用")]
    QuickApp = 128

Quick App

System.AppEnvironmentEnum.WeChatMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("微信小程序")]
    WeChatMiniProgram = 256

WeChat Mini Program

System.AppEnvironmentEnum.WeChatOfficialAccount

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("微信公众号")]
    WeChatOfficialAccount = 512

WeChat public account

System.AppEnvironmentEnum.WeChatServiceAccount

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("微信服务号")]
    WeChatServiceAccount = 1024

WeChat service account

System.AppEnvironmentEnum.WeChatOpenPlatform

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("微信开放平台")]
    WeChatOpenPlatform = 2048

WeChat Open Platform

System.AppEnvironmentEnum.WorkWeChat

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("企业微信")]
    WorkWeChat = 4096

WeCom

System.AppEnvironmentEnum.AlipayMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("支付宝小程序")]
    AlipayMiniProgram = 8192

Alipay Mini Program

System.AppEnvironmentEnum.TiktokMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("抖音小程序")]
    TiktokMiniProgram = 16384

Douyin Mini Program

System.AppEnvironmentEnum.DingTalkMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("钉钉小程序")]
    DingTalkMiniProgram = 32768

DingTalk Mini Program

System.AppEnvironmentEnum.FeiShuMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("飞书小程序")]
    FeiShuMiniProgram = 65536

Feishu Mini Program

System.AppEnvironmentEnum.QQMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("QQ小程序")]
    QQMiniProgram = 131072

QQ Mini Program

System.AppEnvironmentEnum.BaiduMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("百度小程序")]
    BaiduMiniProgram = 262144

Baidu Mini Program

System.AppEnvironmentEnum.KuaiShouMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("快手小程序")]
    KuaiShouMiniProgram = 524288

Kuaishou Mini Program

System.AppEnvironmentEnum.XiaoHongShuMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("小红书小程序")]
    XiaoHongShuMiniProgram = 1048576

Xiaohongshu Mini Program

System.AppEnvironmentEnum.JDMiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("京东小程序")]
    JDMiniProgram = 2097152

JD Mini Program

System.AppEnvironmentEnum.Api

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Api")]
    Api = 2147483648

API

System.AppEnvironmentEnum.Other

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("其他")]
    Other = 4294967296

Other

System.AppEnvironmentEnum.Desktop

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("桌面端")]
    Desktop = Windows | Mac | Linux

Desktop

System.AppEnvironmentEnum.Mobile

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("移动端")]
    Mobile = Android | IOS

Mobile

System.AppEnvironmentEnum.MobileThree

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("移动端(三端)")]
    MobileThree = Android | IOS | MiniProgram

Mobile (three platforms)

System.AppEnvironmentEnum.MiniProgram

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("小程序")]
    MiniProgram = QuickApp
                  | WeChatMiniProgram
                  | AlipayMiniProgram
                  | TiktokMiniProgram
                  | DingTalkMiniProgram
                  | FeiShuMiniProgram
                  | QQMiniProgram
                  | BaiduMiniProgram
                  | KuaiShouMiniProgram
                  | XiaoHongShuMiniProgram
                  | JDMiniProgram

Mini Program

System.EnvironmentTypeEnum

Source · Targets: net8.0, net9.0, net10.0

csharp
[Flags]
[FastEnum("环境类型枚举")]
public enum EnvironmentTypeEnum : byte

Environment type enum

System.EnvironmentTypeEnum.Production

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("生产环境")]
    Production = 1

Production environment

Remarks: Live production environment

System.EnvironmentTypeEnum.Development

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("开发环境")]
    Development = 2

Development environment

Remarks: Local development environment

System.EnvironmentTypeEnum.Test

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("测试环境")]
    Test = 4

Test environment

Remarks: Functional testing environment for verifying features or fixes

System.EnvironmentTypeEnum.UAT

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("测试验收环境")]
    UAT = 8

UAT acceptance testing environment

Remarks: Acceptance testing environment for checking requirements and expectations

System.EnvironmentTypeEnum.PreProduction

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("预生产环境")]
    PreProduction = 16

PreProduction environment

Remarks: Preproduction environment for final testing and verification

System.EnvironmentTypeEnum.GrayDeployment

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("灰度环境")]
    GrayDeployment = 32

GrayDeployment environment

Remarks: Staged rollout environment for limited testing and acceptance before production deployment

System.EnvironmentTypeEnum.StressTest

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("压测环境")]
    StressTest = 64

StressTest environment

Remarks: Environment for load and stress testing

System.HttpRequestActionEnum

Source · Targets: net8.0, net9.0, net10.0

csharp
[FastEnum("Http请求行为枚举")]
public enum HttpRequestActionEnum

HTTP request action enum

System.HttpRequestActionEnum.None

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("未知")]
    None = 0

Unknown

System.HttpRequestActionEnum.Auth

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("鉴权")]
    Auth = 1

Authentication

System.HttpRequestActionEnum.Paged

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("分页")]
    Paged = 11

Pagination

System.HttpRequestActionEnum.Query

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("查询")]
    Query = 12

Query

System.HttpRequestActionEnum.Add

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("添加")]
    Add = 21

Add

System.HttpRequestActionEnum.Edit

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("编辑")]
    Edit = 31

Edit

System.HttpRequestActionEnum.Delete

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("删除")]
    Delete = 41

Delete

System.HttpRequestActionEnum.Submit

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("提交")]
    Submit = 51

Submit

System.HttpRequestActionEnum.Upload

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("上传")]
    Upload = 61

Upload

System.HttpRequestActionEnum.Download

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("下载")]
    Download = 62

Download

System.HttpRequestActionEnum.Import

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("导入")]
    Import = 71

Import

System.HttpRequestActionEnum.Export

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("导出")]
    Export = 72

Export

System.HttpRequestActionEnum.Notify

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("通知")]
    Notify = 253

Notification

System.HttpRequestActionEnum.Callback

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("回调")]
    Callback = 254

Callback

System.HttpRequestActionEnum.Other

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("其他")]
    Other = 255

Other

System.HttpRequestMethodEnum

Source · Targets: net8.0, net9.0, net10.0

csharp
[FastEnum("Http请求方式枚举")]
public enum HttpRequestMethodEnum

HTTP request method enum

System.HttpRequestMethodEnum.Unknown

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("未知请求")]
    Unknown = 0

Unknown request

Remarks: There is no current HTTP request context, or the request method is unrecognized

System.HttpRequestMethodEnum.Get

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Get请求")]
    Get = 1

GET request

Remarks: Retrieves a server resource. GET parameters are sent in the URL query string. GET is idempotent: repeating the same request should have the same intended effect

System.HttpRequestMethodEnum.Post

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Post请求")]
    Post = 2

POST request

Remarks: Submits data for server processing. POST sends parameters in the request body and is not necessarily idempotent; repeated requests may produce different effects

System.HttpRequestMethodEnum.Put

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Put请求")]
    Put = 4

PUT request

Remarks: Updates the specified server resource by storing the request-body data at the target URL

System.HttpRequestMethodEnum.Delete

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Delete请求")]
    Delete = 8

DELETE request

Remarks: Deletes the server resource identified by the target URL

System.HttpRequestMethodEnum.Patch

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Patch请求")]
    Patch = 16

PATCH request

Remarks: Partially updates a server resource by applying request-body data to selected fields at the target URL

System.HttpRequestMethodEnum.Head

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Head请求")]
    Head = 32

HEAD request

Remarks: Similar to GET, but the response has no entity body; mainly used to retrieve resource metadata such as response headers

System.HttpRequestMethodEnum.Options

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Options请求")]
    Options = 64

OPTIONS request

Remarks: Retrieves communication options for a resource, such as supported request methods and response headers

System.HttpRequestMethodEnum.Connect

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Connect请求")]
    Connect = 128

CONNECT request

Remarks: Establishes a network connection to the target resource, typically an HTTPS tunnel forwarding traffic to the HTTPS server

System.HttpRequestMethodEnum.Trace

Source · Targets: net8.0, net9.0, net10.0

csharp
[Description("Trace请求")]
    Trace = 256

TRACE request

Remarks: Traces the request-response path, primarily for diagnostics

Fast.Runtime.HttpContextExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class HttpContextExtension

Extensions for HttpContext

Fast.Runtime.HttpContextExtension.UnifyResponseTimestamp

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void UnifyResponseTimestamp(this HttpContext httpContext, long timestamp)

Sets the normalized response timestamp

  • Parameter httpContext: Current request context
  • Parameter timestamp: Timestamp

Fast.Runtime.HttpContextExtension.UnifyResponseTimestamp

Source · Targets: net8.0, net9.0, net10.0

csharp
public static long UnifyResponseTimestamp(this HttpContext httpContext)

Gets the normalized response timestamp

  • Parameter httpContext: Current request context
  • Returns: Normalized response timestamp

Fast.Runtime.HttpContextExtension.GetMetadata

Source · Targets: net8.0, net9.0, net10.0

csharp
public static TAttribute GetMetadata<TAttribute>(this HttpContext httpContext) where TAttribute : class

Gets the specified attribute from endpoint metadata

  • Parameter httpContext: Current request context
  • Type parameter TAttribute: Attribute type to find
  • Returns: Matching attribute instance, or null when none is found

Fast.Runtime.HttpContextExtension.GetMetadata

Source · Targets: net8.0, net9.0, net10.0

csharp
public static object GetMetadata(this EndpointMetadataCollection metadata, Type attributeType)

Gets the specified attribute from endpoint metadata

  • Parameter metadata: Current metadata
  • Parameter attributeType: Attribute type to read
  • Returns: Matching attribute instance, or null when none is found

Fast.Runtime.HttpContextExtension.GetMetadata

Source · Targets: net8.0, net9.0, net10.0

csharp
public static object GetMetadata(this HttpContext httpContext, Type attributeType)

Gets the specified attribute from endpoint metadata

  • Parameter httpContext: Current request context
  • Parameter attributeType: Attribute type to read
  • Returns: Matching attribute instance, or null when none is found

Fast.Runtime.HttpContextExtension.SignInToSwagger

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void SignInToSwagger(this HttpContext httpContext, string accessToken)

Enables automatic login for normalized API documentation

  • Parameter httpContext: Current request context
  • Parameter accessToken: Access token

Fast.Runtime.HttpContextExtension.SignOutToSwagger

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void SignOutToSwagger(this HttpContext httpContext)

Signs out of normalized API documentation

  • Parameter httpContext: Current request context

Fast.Runtime.HttpContextExtension.LocalIpv4

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string LocalIpv4(this HttpContext httpContext)

Local IPv4 address

  • Parameter httpContext: Current request context
  • Returns: Local IPv4 address; returns an empty string when there is no current request context

Fast.Runtime.HttpContextExtension.LocalIpv6

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string LocalIpv6(this HttpContext httpContext)

Local IPv6 address

  • Parameter httpContext: Current request context
  • Returns: Local IPv6 address; returns an empty string when there is no current request context

Fast.Runtime.HttpContextExtension.RemoteIpv4

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string RemoteIpv4(this HttpContext httpContext)

Gets the remote IPv4 address after trusted-proxy processing

  • Parameter httpContext: Current request context
  • Returns: Remote IPv4 address; returns an empty string when there is no request context or the remote address is not IPv4

Fast.Runtime.HttpContextExtension.RemoteIpv6

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string RemoteIpv6(this HttpContext httpContext)

Gets the remote IPv6 address after trusted-proxy processing

  • Parameter httpContext: Current request context
  • Returns: Remote IPv6 address; returns an empty string when there is no request context or the remote address is not IPv6

Fast.Runtime.HttpContextExtension.RequestUserAgent

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string RequestUserAgent(this HttpContext httpContext, string userAgentHeaderKey = "User-Agent")

Request User-Agent string

  • Parameter httpContext: Current request context
  • Parameter userAgentHeaderKey: Name of the header containing user-agent information
  • Returns: Request User-Agent string

Fast.Runtime.HttpContextExtension.RequestUserAgentInfo

Source · Targets: net8.0, net9.0, net10.0

csharp
public static UserAgentInfo RequestUserAgentInfo(this HttpContext httpContext)

Request user-agent information

Remarks: Requires a reference to the UAParser assembly to parse successfully; otherwise returns null

  • Parameter httpContext: Current request context
  • Returns: Request user-agent information; returns null when there is no current request context

Fast.Runtime.HttpContextExtension.RemoteIpv4Info

Source · Targets: net8.0, net9.0, net10.0

csharp
public static WanNetIPInfo RemoteIpv4Info(this HttpContext httpContext, string ip = null)

Remote IPv4 address information

Remarks: Includes a 24-hour memory cache when memory caching is registered; otherwise caching is not used

  • Parameter httpContext: Current request context
  • Parameter ip: IP address to look up; defaults to null, which selects the current remote IPv4 address
  • Returns: Remote IPv4 address information; returns null when there is no current request context

Fast.Runtime.HttpContextExtension.RemoteIpv4InfoAsync

Source · Targets: net8.0, net9.0, net10.0

csharp
public static async Task<WanNetIPInfo> RemoteIpv4InfoAsync(this HttpContext httpContext, string ip = null)

Remote IPv4 address information

Remarks: Includes a 24-hour memory cache when memory caching is registered; otherwise caching is not used

  • Parameter httpContext: Current request context
  • Parameter ip: IP address to look up; defaults to null, which selects the current remote IPv4 address
  • Returns: A task containing remote IPv4 address information; its result is null when there is no current request context

Fast.Runtime.HttpContextExtension.GetControllerActionDescriptor

Source · Targets: net8.0, net9.0, net10.0

csharp
public static ControllerActionDescriptor GetControllerActionDescriptor(this HttpContext httpContext)

Gets the controller/action descriptor

  • Parameter httpContext: Current request context
  • Returns: Controller/action descriptor; returns null when there is no current request context

Fast.Runtime.HttpContextExtension.ReadBodyContentAsync

Source · Targets: net8.0, net9.0, net10.0

csharp
public static async Task<string> ReadBodyContentAsync(this HttpContext httpContext)

Reads the request body

Remarks: First register app.EnableBuffering() in Startup.Configure

  • Parameter httpContext: Current request context
  • Returns: A task whose result is the request-body content

Fast.Runtime.HttpContextExtension.ReadBodyContentAsync

Source · Targets: net8.0, net9.0, net10.0

csharp
public static async Task<string> ReadBodyContentAsync(this HttpRequest httpRequest)

Reads the request body

Remarks: First register app.EnableBuffering() in Startup.Configure

  • Parameter httpRequest: Current HTTP request
  • Returns: A task whose result is the request-body content

Fast.Runtime.HttpContextExtension.RequestUrlAddress

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string RequestUrlAddress(this HttpContext httpContext)

Complete request URL

  • Parameter httpContext: Current request context
  • Returns: Complete request URL

Fast.Runtime.HttpContextExtension.RequestUrlAddress

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string RequestUrlAddress(this HttpRequest httpRequest)

Complete request URL

  • Parameter httpRequest: Current HTTP request
  • Returns: Complete request URL

Fast.Runtime.HttpContextExtension.RefererUrlAddress

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string RefererUrlAddress(this HttpContext httpContext, string refererHeaderKey = "Referer")

Referrer URL

  • Parameter httpContext: Current request context
  • Parameter refererHeaderKey: Name of the header containing the referrer URL
  • Returns: Referrer URL

Fast.Runtime.HttpContextExtension.SetResponseStatusCodes

Source · Targets: net8.0, net9.0, net10.0

csharp
public static void SetResponseStatusCodes(this HttpContext httpContext, int statusCode, int[] return200StatusCodes = null,
        int[][] adaptStatusCodes = null)

Sets the response status code

Remarks: Example: return200StatusCodes = [401, 403]; adaptStatusCodes = [[401, 200], [403, 200]]

  • Parameter httpContext: Current request context
  • Parameter statusCode: HTTP status code
  • Parameter return200StatusCodes: Status codes to return as 200; supports only codes of 400 or above, excluding 404
  • Parameter adaptStatusCodes: Status-code remapping; supports only codes of 400 or above, excluding 404

System.UserFriendlyException

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public class UserFriendlyException : Exception

User-friendly exception

System.UserFriendlyException.UserFriendlyException

Source · Targets: net8.0, net9.0, net10.0

csharp
public UserFriendlyException() : base("Bad Request")

Initializes a new instance of the class

System.UserFriendlyException.UserFriendlyException

Source · Targets: net8.0, net9.0, net10.0

csharp
public UserFriendlyException(string message) : base(message ?? "Bad Request")

Initializes a new instance of the class

  • Parameter message: Message to record or return

System.UserFriendlyException.UserFriendlyException

Source · Targets: net8.0, net9.0, net10.0

csharp
public UserFriendlyException(string message, object errorCode) : base(message ?? "Bad Request")

Initializes a new instance of the class

  • Parameter message: Message to record or return
  • Parameter errorCode: Error code identifying the error type

System.UserFriendlyException.UserFriendlyException

Source · Targets: net8.0, net9.0, net10.0

csharp
public UserFriendlyException(string message, Exception innerException) : base(message ?? "Bad Request", innerException)

Initializes a new instance of the class

  • Parameter message: Message to record or return
  • Parameter innerException: Inner exception that caused this exception

System.UserFriendlyException.UserFriendlyException

Source · Targets: net8.0, net9.0, net10.0

csharp
public UserFriendlyException(string message, object errorCode, Exception innerException) : base(message ?? "Bad Request",
        innerException)

Initializes a new instance of the class

  • Parameter message: Message to record or return
  • Parameter errorCode: Error code identifying the error type
  • Parameter innerException: Inner exception that caused this exception

System.UserFriendlyException.ErrorCode

Source · Targets: net8.0, net9.0, net10.0

csharp
public object ErrorCode { get; set; }

Error code

System.UserFriendlyException.OriginErrorCode

Source · Targets: net8.0, net9.0, net10.0

csharp
public object OriginErrorCode { get; set; }

Original error code before ErrorCode was overridden

System.UserFriendlyException.ErrorMessage

Source · Targets: net8.0, net9.0, net10.0

csharp
public object ErrorMessage { get; set; }

Error message; object values are supported

System.UserFriendlyException.StatusCode

Source · Targets: net8.0, net9.0, net10.0

csharp
public int StatusCode { get; set; } = StatusCodes.Status400BadRequest;

Status code

System.UserFriendlyException.ValidationException

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool ValidationException { get; set; } = false;

Whether this is a data-validation exception

System.UserFriendlyException.Data

Source · Targets: net8.0, net9.0, net10.0

csharp
public new object Data { get; set; }

Additional data

Fast.Runtime.AssemblyExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
public static class AssemblyExtension

Extensions for Assembly

Fast.Runtime.AssemblyExtension.GetEntryRuntimeLibraries

Source · Targets: net8.0, net9.0, net10.0

csharp
public static List<DependencyLibrary> GetEntryRuntimeLibraries(this Assembly assembly)

Gets entry runtime libraries

Remarks: Standalone/single-file publishing is currently unsupported

  • Parameter assembly: Target assembly
  • Returns: Entry runtime library collection

Fast.Runtime.AssemblyExtension.GetEntryReferencedAssembly

Source · Targets: net8.0, net9.0, net10.0

csharp
public static List<Assembly> GetEntryReferencedAssembly(this Assembly assembly,
        List<DependencyLibrary> dependencyLibraryList = null)

Gets assemblies referenced by the entry assembly

Remarks: Standalone/single-file publishing is currently unsupported

  • Parameter assembly: Target assembly
  • Parameter dependencyLibraryList: Application dependency library collection
  • Returns: Collection of assemblies referenced by the entry assembly

Fast.Runtime.AssemblyExtension.GetAssemblyTypes

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IEnumerable<Type> GetAssemblyTypes(this Assembly assembly, Func<Type, bool> typeFilter = null)

Gets all types in an assembly

Remarks: Returns publicly declared types by default; a filter can further restrict the results

  • Parameter assembly: Target assembly
  • Parameter typeFilter: Delegate used to filter assembly types
  • Returns: Collection of types in the assembly

Fast.Runtime.IConfigurationExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class IConfigurationExtension

Extensions for IConfiguration

Fast.Runtime.IConfigurationExtension.LoadPostConfigure

Source · Targets: net8.0, net9.0, net10.0

csharp
public static T LoadPostConfigure<T>(this T type) where T : IPostConfigure

Loads post-configuration

  • Parameter type: Target type
  • Type parameter T: Options type to post-configure
  • Returns: Loaded post-configuration

Fast.Runtime.IMvcBuilderExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class IMvcBuilderExtension

Provides extension methods for IMvcBuilder

Fast.Runtime.IMvcBuilderExtension.AddMvcFilter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IMvcBuilder AddMvcFilter<TFilter>(this IMvcBuilder builder, Action<MvcOptions> configure = null)
        where TFilter : IFilterMetadata

Registers an MVC filter

  • Parameter builder: Application builder to configure
  • Parameter configure: Additional MVC configuration callback
  • Type parameter TFilter: MVC filter type to register
  • Returns: Returns the current MVC builder for fluent calls

Fast.Runtime.IServiceCollectionExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class IServiceCollectionExtension

Provides extension methods for IServiceCollection

Fast.Runtime.IServiceCollectionExtension.AddConfigurableOptions

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IServiceCollection AddConfigurableOptions<TOptions>(this IServiceCollection services, string path = null)
        where TOptions : class, new()

Adds options configuration

  • Parameter services: The service collection to add services to
  • Parameter path: Corresponding configuration key
  • Type parameter TOptions: Configuration options type
  • Returns: Returns the current service collection for chaining

Fast.Runtime.IServiceCollectionExtension.AddMvcFilter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IServiceCollection AddMvcFilter<TFilter>(this IServiceCollection services, Action<MvcOptions> configure = null)
        where TFilter : IFilterMetadata

Registers an MVC filter

  • Parameter services: The service collection to add services to
  • Parameter configure: Additional MVC configuration callback
  • Type parameter TFilter: MVC filter type to register
  • Returns: Returns services for chaining

Fast.Runtime.IServiceCollectionExtension.AddMvcFilter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IServiceCollection AddMvcFilter(this IServiceCollection services, IFilterMetadata filter,
        Action<MvcOptions> configure = null)

Registers an MVC filter

  • Parameter services: The service collection to add services to
  • Parameter filter: MVC filter instance to register
  • Parameter configure: Additional MVC configuration callback
  • Returns: Returns services for chaining

Fast.Runtime.TypeExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
public static class TypeExtension

Extensions for Type

Fast.Runtime.TypeExtension.CreatePropertySetter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Action<object, object> CreatePropertySetter(this Type type, PropertyInfo propertyInfo)

Creates a property setter

  • Parameter type: Target type
  • Parameter propertyInfo: Reflection metadata for the target property
  • Returns: Created property setter

Fast.Runtime.TypeExtension.CreateFieldSetter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Action<object, object> CreateFieldSetter(this Type type, FieldInfo fieldInfo)

Creates a field setter

  • Parameter type: Target type
  • Parameter fieldInfo: Reflection metadata for the target field
  • Returns: Created field setter

Fast.Runtime.TypeExtension.CreatePropertyGetter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Func<object, object> CreatePropertyGetter(this Type type, PropertyInfo propertyInfo)

Creates a property accessor

  • Parameter type: Target type
  • Parameter propertyInfo: Reflection metadata for the target property
  • Returns: Created property accessor

Fast.Runtime.TypeExtension.CreateFieldGetter

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Func<object, object> CreateFieldGetter(this Type type, FieldInfo fieldInfo)

Creates a field accessor

  • Parameter type: Target type
  • Parameter fieldInfo: Reflection metadata for the target field
  • Returns: Created field accessor

Fast.Runtime.UserFriendlyExceptionExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class UserFriendlyExceptionExtension

Provides extension methods for UserFriendlyException

Fast.Runtime.UserFriendlyExceptionExtension.StatusCode

Source · Targets: net8.0, net9.0, net10.0

csharp
public static UserFriendlyException StatusCode(this UserFriendlyException exception,
        int statusCode = StatusCodes.Status400BadRequest)

Sets the exception status code

  • Parameter exception: Exception to handle
  • Parameter statusCode: HTTP status code
  • Returns: Sets the exception status code

Fast.Runtime.UserFriendlyExceptionExtension.WithData

Source · Targets: net8.0, net9.0, net10.0

csharp
public static UserFriendlyException WithData(this UserFriendlyException exception, object data)

Sets additional data

  • Parameter exception: Exception to handle
  • Parameter data: Data to process or transmit
  • Returns: Sets additional data

Fast.Runtime.IPostConfigure

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public interface IPostConfigure

Post-configuration interface

Remarks: Supplies default configuration that cannot be completed in a constructor or during options binding

Fast.Runtime.IPostConfigure.PostConfigure

Source · Targets: net8.0, net9.0, net10.0

csharp
void PostConfigure();

Applies supplementary configuration after options binding completes

Fast.Runtime.DependencyLibrary

Source · Targets: net8.0, net9.0, net10.0

csharp
public class DependencyLibrary

Model for entries in the libraries node of .deps.json

Fast.Runtime.DependencyLibrary.Type

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Type { get; }

Type

Remarks: package denotes a referenced package; project denotes a locally referenced project

Fast.Runtime.DependencyLibrary.Name

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Name { get; }

Assembly name

Fast.Runtime.DependencyLibrary.FileName

Source · Targets: net8.0, net9.0, net10.0

csharp
public string FileName { get; }

Assembly DLL filename without its extension

Remarks: Read from the runtime node; defaults to Name when empty. May differ from Name in some cases

Fast.Runtime.DependencyLibrary.Version

Source · Targets: net8.0, net9.0, net10.0

csharp
public string Version { get; }

Assembly version

Fast.Runtime.DependencyLibrary.Serviceable

Source · Targets: net8.0, net9.0, net10.0

csharp
public bool Serviceable { get; }

Whether the assembly is serviceable

System.Linq.LinqExpression

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class LinqExpression

Provides LINQ expression extensions

System.Linq.LinqExpression.Create

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> Create<TSource>(Expression<Func<TSource, bool>> expression)

Creates a LINQ/lambda expression

  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Created LINQ/lambda expression

System.Linq.LinqExpression.Create

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> Create<TSource>(Expression<Func<TSource, int, bool>> expression)

Creates a LINQ/lambda expression with index support

  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Created LINQ/lambda expression with index support

System.Linq.LinqExpression.And

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> And<TSource>()

Creates an AND expression

  • Type parameter TSource: Source object type
  • Returns: Created AND expression

System.Linq.LinqExpression.IndexAnd

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> IndexAnd<TSource>()

Creates an AND expression with index support

  • Type parameter TSource: Source object type
  • Returns: Created AND expression with index support

System.Linq.LinqExpression.Or

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> Or<TSource>()

Creates an OR expression

  • Type parameter TSource: Source object type
  • Returns: Created OR expression

System.Linq.LinqExpression.IndexOr

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> IndexOr<TSource>()

Creates an OR expression with index support

  • Type parameter TSource: Source object type
  • Returns: Created OR expression with index support

System.Linq.ExpressionExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class ExpressionExtension

Provides expression extensions

System.Linq.ExpressionExtension.Compose

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<TSource> Compose<TSource>(this Expression<TSource> expression, Expression<TSource> extendExpression,
        Func<Expression, Expression, Expression> mergeWay)

Composes two expressions

  • Parameter expression: Expression to compose or execute
  • Parameter extendExpression: Expression used to compose two expressions
  • Parameter mergeWay: Composition operation for the two expressions
  • Type parameter TSource: Source object type
  • Returns: Composes two expressions

System.Linq.ExpressionExtension.And

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> And<TSource>(this Expression<Func<TSource, bool>> expression,
        Expression<Func<TSource, bool>> extendExpression)

Combines two expressions using AND

  • Parameter expression: Expression to compose or execute
  • Parameter extendExpression: Expression used to combine two expressions using AND
  • Type parameter TSource: Source object type
  • Returns: Combines two expressions using AND

System.Linq.ExpressionExtension.And

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> And<TSource>(this Expression<Func<TSource, int, bool>> expression,
        Expression<Func<TSource, int, bool>> extendExpression)

Combines two expressions using AND with index support

  • Parameter expression: Expression to compose or execute
  • Parameter extendExpression: Expression used to combine two expressions using AND with index support
  • Type parameter TSource: Source object type
  • Returns: Combines two expressions using AND with index support

System.Linq.ExpressionExtension.AndIf

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> AndIf<TSource>(this Expression<Func<TSource, bool>> expression, bool condition,
        Expression<Func<TSource, bool>> extendExpression)

Combines two expressions using AND when the condition is satisfied

  • Parameter expression: Expression to compose or execute
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter extendExpression: Expression used for conditional AND composition
  • Type parameter TSource: Source object type
  • Returns: Combines two expressions using AND when the condition is satisfied

System.Linq.ExpressionExtension.AndIf

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> AndIf<TSource>(this Expression<Func<TSource, int, bool>> expression,
        bool condition, Expression<Func<TSource, int, bool>> extendExpression)

Conditionally combines two expressions using AND with index support

  • Parameter expression: Expression to compose or execute
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter extendExpression: Expression used for conditional AND composition with index support
  • Type parameter TSource: Source object type
  • Returns: Conditionally combines two expressions using AND with index support

System.Linq.ExpressionExtension.Or

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> Or<TSource>(this Expression<Func<TSource, bool>> expression,
        Expression<Func<TSource, bool>> extendExpression)

Combines two expressions using OR

  • Parameter expression: Expression to compose or execute
  • Parameter extendExpression: Expression used to combine two expressions using OR
  • Type parameter TSource: Source object type
  • Returns: Combines two expressions using OR

System.Linq.ExpressionExtension.Or

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> Or<TSource>(this Expression<Func<TSource, int, bool>> expression,
        Expression<Func<TSource, int, bool>> extendExpression)

Combines two expressions using OR with index support

  • Parameter expression: Expression to compose or execute
  • Parameter extendExpression: Expression used to combine two expressions using OR with index support
  • Type parameter TSource: Source object type
  • Returns: Combines two expressions using OR with index support

System.Linq.ExpressionExtension.OrIf

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, bool>> OrIf<TSource>(this Expression<Func<TSource, bool>> expression, bool condition,
        Expression<Func<TSource, bool>> extendExpression)

Combines two expressions using OR when the condition is satisfied

  • Parameter expression: Expression to compose or execute
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter extendExpression: Expression used for conditional OR composition
  • Type parameter TSource: Source object type
  • Returns: Combines two expressions using OR when the condition is satisfied

System.Linq.ExpressionExtension.OrIf

Source · Targets: net8.0, net9.0, net10.0

csharp
public static Expression<Func<TSource, int, bool>> OrIf<TSource>(this Expression<Func<TSource, int, bool>> expression,
        bool condition, Expression<Func<TSource, int, bool>> extendExpression)

Conditionally combines two expressions using OR with index support

  • Parameter expression: Expression to compose or execute
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter extendExpression: Expression used for conditional OR composition with index support
  • Type parameter TSource: Source object type
  • Returns: Conditionally combines two expressions using OR with index support

System.Linq.ExpressionExtension.GetExpressionPropertyName

Source · Targets: net8.0, net9.0, net10.0

csharp
public static string GetExpressionPropertyName<TSource>(this Expression<Func<TSource, object>> expression)

Gets the property name from a lambda; only expressions of the form u => u.Property are supported

  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Property name from a lambda of the form u => u.Property

System.Linq.IEnumerableExtension

Source · Targets: net8.0, net9.0, net10.0

csharp
[SuppressSniffer]
public static class IEnumerableExtension

IEnumerable extensions

System.Linq.IEnumerableExtension.OrderBy

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> OrderBy<TSource, TKey>(this IQueryable<TSource> sources, bool condition,
        Expression<Func<TSource, TKey>> keySelector)

Applies OrderBy when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter keySelector: Delegate that produces the sort key
  • Type parameter TSource: Source object type
  • Type parameter TKey: Generic type
  • Returns: Applies OrderBy when the condition is satisfied

System.Linq.IEnumerableExtension.OrderByDescending

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> OrderByDescending<TSource, TKey>(this IQueryable<TSource> sources, bool condition,
        Expression<Func<TSource, TKey>> keySelector)

Applies OrderByDescending when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter keySelector: Delegate that produces the sort key
  • Type parameter TSource: Source object type
  • Type parameter TKey: Generic type
  • Returns: Applies OrderByDescending when the condition is satisfied

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> sources, bool condition,
        Expression<Func<TSource, bool>> expression)

Applies Where when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Applies Where when the condition is satisfied

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> sources, bool condition,
        Expression<Func<TSource, int, bool>> expression)

Applies Where with index support when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Applies Where with index support when the condition is satisfied

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> sources,
        params Expression<Func<TSource, bool>>[] expressions)

Combines multiple expressions using AND

  • Parameter sources: Source sequence to query or compose
  • Parameter expressions: Expressions to combine
  • Type parameter TSource: Source object type
  • Returns: Combines multiple expressions using AND

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> sources,
        params Expression<Func<TSource, int, bool>>[] expressions)

Combines multiple expressions using AND with index support

  • Parameter sources: Source sequence to query or compose
  • Parameter expressions: Expressions to combine
  • Type parameter TSource: Source object type
  • Returns: Combines multiple expressions using AND with index support

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> sources,
        params (bool condition, Expression<Func<TSource, bool>> expression)[] conditionExpressions)

Applies WhereOr when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter conditionExpressions: Expressions included conditionally in the composition
  • Type parameter TSource: Source object type
  • Returns: Applies WhereOr when the condition is satisfied

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IQueryable<TSource> Where<TSource>(this IQueryable<TSource> sources,
        params (bool condition, Expression<Func<TSource, int, bool>> expression)[] conditionExpressions)

Applies WhereOr with index support when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter conditionExpressions: Expressions included conditionally in the composition
  • Type parameter TSource: Source object type
  • Returns: Applies WhereOr with index support when the condition is satisfied

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> sources, bool condition,
        Func<TSource, bool> expression)

Applies Where when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Builds a collection of conditional Where expressions

System.Linq.IEnumerableExtension.Where

Source · Targets: net8.0, net9.0, net10.0

csharp
public static IEnumerable<TSource> Where<TSource>(this IEnumerable<TSource> sources, bool condition,
        Func<TSource, int, bool> expression)

Applies Where with index support when the condition is satisfied

  • Parameter sources: Source sequence to query or compose
  • Parameter condition: Condition deciding whether to apply this operation
  • Parameter expression: Expression to compose or execute
  • Type parameter TSource: Source object type
  • Returns: Builds a collection of conditional Where expressions with index support