Browse pages
LS2006: Endpoint Name Lacks Its Suffix
LS2006 is a compiler check that reports an endpoint, the type that maps one use case to HTTP, whose name does not end in Endpoint, so the model builder cannot find it by its file name. This page states what the rule reports, where the error sits, and how to complete the endpoint name.
Reference#
What the Rule Enforces#
LS2006 enforces Use architectural suffixes (litespec/workspace/naming#use-architectural-suffixes). It runs in WebApi only. Its category is LiteSpec.Layers. It reports an error and is enabled by default, as the Analyzers overview describes.
What the Rule Reports#
The rule reports a class that implements an interface named IEndpoint unless its name ends in Endpoint. The diagnostic sits on the type name.
Failing Example#
internal sealed class CreateDraftRoute : IEndpoint
{
}Passing Example#
internal sealed class CreateDraftEndpoint : IEndpoint
{
}How to Fix#
End the class name in Endpoint, keeping the use-case prefix the file name carries.
Notes#
What the Rule Ignores#
The rule does not report a class that implements no interface named IEndpoint, and it does not report interfaces. It does not run outside WebApi.