Create
public final class Create<T> : CreateEndpoint where T : CorvusModel
A class that provides functionality to create objects of a generic type
T conforming to CorvusModel.
-
The return type of the
.handler().Declaration
Swift
public typealias QuerySubject = T -
The HTTP operation type of the component.
Declaration
Swift
public let operationType: OperationType -
An initializer for creation without arguments.
Declaration
Swift
public init() -
A method that saves objects from a
Requestto the database.Throws
AnAborterror if something goes wrong.Declaration
Swift
public func handler(_ req: Request) throws -> EventLoopFuture<QuerySubject>Parameters
reqAn incoming
Request.Return Value
An
EventLoopFuturecontaining the saved object.
Create Class Reference