/// <summary> /// Create a confirmation code /// </summary> /// <param name="input">The code input</param> /// <returns></returns> public Task <ConfirmationCode> Create(ConfirmationCode input) { // generate id if necessary input.Id ??= StdIdGenerator.Next(IdentityObjects.CNF)?.ToLowerInvariant(); return(this.dataOps.Connect().QueryFirst("Confirmation", "Create").ExecuteAsync <ConfirmationCode>(input)); }
/// <summary> /// Creates entity based on input /// </summary> /// <param name="input">The creation input</param> /// <returns></returns> public Task <UserModel> Create(CreateUserModel input) { // generate id if necessary input.Id ??= StdIdGenerator.Next(IdentityObjects.USER)?.ToLowerInvariant(); // handle case sensitivity of identifiers input.Email = input.Email?.ToLowerInvariant(); input.Username = input.Username?.ToLowerInvariant(); // add user to the database return(this.dataOps.Connect().QueryFirst("User", "Create").ExecuteAsync <UserModel>(input)); }