Class CreateController<T>
public class CreateController<T> : ScreenControllerBase<CreateModel<T>, CreateView, CreateOptions>, IScreenController<CreateModel<T>>, IScreenController where T : IEntity<T>
Type Parameters
T
- Inheritance
-
CreateController<T>
- Implements
- Inherited Members
Constructors
CreateController(IServices, Func<IPrincipal, Task<T>>, Func<T, Task>?, Action<CreateOptions>?)
public CreateController(IServices services, Func<IPrincipal, Task<T>> entityFactory, Func<T, Task>? entityInitialiser, Action<CreateOptions>? configure = null)
Parameters
servicesIServicesentityFactoryFunc<IPrincipal, Task<T>>entityInitialiserFunc<T, Task>configureAction<CreateOptions>
Properties
Entity
protected T? Entity { get; }
Property Value
- T
Methods
ActivateValidation()
public void ActivateValidation()
CreateContentSubcontroller(T)
protected virtual ContentControllerBase<T> CreateContentSubcontroller(T entity)
Parameters
entityT
Returns
CreateUninitialisedModel(ISurface)
protected override CreateModel<T> CreateUninitialisedModel(ISurface s)
Parameters
sISurface
Returns
- CreateModel<T>
CreateValidatedAsyncCommand(string, Func<Task>, ValidationIntent?, MessageLevel)
Create an async command gated by this screen's validation: it validates under intent
(default Save), displays the findings, and only runs the action when none reach blockAt.
Confirm/Submit-like commands typically gate at Warning.
protected IScreenCommand CreateValidatedAsyncCommand(string name, Func<Task> asyncAction, ValidationIntent? intent = null, MessageLevel blockAt = MessageLevel.Error)
Parameters
namestringasyncActionFunc<Task>intentValidationIntent?blockAtMessageLevel
Returns
CreateValidatedCommand(string, Action, ValidationIntent?, MessageLevel)
Create a command gated by this screen's validation: it validates under intent
(default Save), displays the findings, and only runs the action when none reach blockAt.
Confirm/Submit-like commands typically gate at Warning.
protected IScreenCommand CreateValidatedCommand(string name, Action action, ValidationIntent? intent = null, MessageLevel blockAt = MessageLevel.Error)
Parameters
namestringactionActionintentValidationIntent?blockAtMessageLevel
Returns
GetCustomCommands(CreateModel<T>)
protected virtual IEnumerable<IScreenCommand> GetCustomCommands(CreateModel<T> vm)
Parameters
vmCreateModel<T>
Returns
GetSaveTask()
protected Task GetSaveTask()
Returns
InitialiseModel(CreateModel<T>)
protected override void InitialiseModel(CreateModel<T> vm)
Parameters
vmCreateModel<T>
OnClosed()
protected override sealed void OnClosed()
OnControllerClosed()
protected virtual void OnControllerClosed()
OnControllerOpened()
protected virtual void OnControllerOpened()
OnCreated()
protected virtual void OnCreated()
OnCreatedAsync()
protected virtual Task OnCreatedAsync()
Returns
OnLoaded()
protected virtual void OnLoaded()
OnLoadedAsync()
protected virtual Task OnLoadedAsync()
Returns
OnOpened()
protected override sealed void OnOpened()
OnSaved()
protected virtual void OnSaved()
OnSavedAsync()
protected virtual Task OnSavedAsync()
Returns
OnSaving()
protected virtual void OnSaving()
OnSavingAsync()
protected virtual Task OnSavingAsync()
Returns
SaveAsync()
public Task<DisplayController<T>?> SaveAsync()
Returns
Events
Saved
public event Action? Saved
Event Type
Saving
public event Action? Saving