Пример #1
0
        public async Task <ActionResult> CommitDraftAsync(string id, CancellationToken cancellationToken)
        {
            InitUserInfo();
            if (!AllowCreate && !AllowUpdate)
            {
                return(ValidationProblem());
            }
            var mainRecordId = await _partService.CommitDraft(id, cancellationToken);

            if (string.IsNullOrEmpty(mainRecordId))
            {
                AssignToModelState(_partService.Errors);
                return(ValidationProblem());
            }

            return(CreatedAtAction(nameof(GetIdAsync), new { id = id }, null));
        }