Class RequireLoadedProjectAttribute
- Namespace
- Hi.MachiningProcs
- Assembly
- HiNc.dll
Action filter for the project-level web-API surface: before a guarded action runs,
verifies a project is loaded (MachiningProject is
non-null). When none is loaded it short-circuits with HTTP 409 and an
NoProjectLoaded() envelope, so a REST / AI caller gets a helpful
“create or load a project first” notice instead of a null-reference 500 (the project-level
members — MachiningActRunner.Config, workpiece, runners — are null until a project is
open). Apply at the controller level; exempt the endpoints that create or load a project
with AllowNoLoadedProjectAttribute.
[AttributeUsage(AttributeTargets.Class|AttributeTargets.Method, AllowMultiple = false)]
public sealed class RequireLoadedProjectAttribute : Attribute, IActionFilter, IFilterMetadata
- Inheritance
-
RequireLoadedProjectAttribute
- Implements
- Inherited Members
- Extension Methods
Methods
OnActionExecuted(ActionExecutedContext)
Called after the action executes, before the action result.
public void OnActionExecuted(ActionExecutedContext context)
Parameters
contextActionExecutedContext
OnActionExecuting(ActionExecutingContext)
Called before the action executes, after model binding is complete.
public void OnActionExecuting(ActionExecutingContext context)
Parameters
contextActionExecutingContext