Beispiel #1
0
        protected override async Task SaveValidateAsync(List <AgentForSave> entities)
        {
            // SQL validation
            int remainingErrorCount = ModelState.MaxAllowedErrors - ModelState.ErrorCount;
            var sqlErrors           = await _repo.Agents_Validate__Save(entities, top : remainingErrorCount);

            // Add errors to model state
            ModelState.AddLocalizedErrors(sqlErrors, _localizer);
        }
Beispiel #2
0
        protected override async Task SaveValidateAsync(List <AgentForSave> entities)
        {
            // TODO: Add definition validation and defaults here

            // No need to invoke SQL if the model state is full of errors
            if (ModelState.HasReachedMaxErrors)
            {
                return;
            }

            // SQL validation
            int remainingErrorCount = ModelState.MaxAllowedErrors - ModelState.ErrorCount;
            var sqlErrors           = await _repo.Agents_Validate__Save(DefinitionId, entities, top : remainingErrorCount);

            // Add errors to model state
            ModelState.AddLocalizedErrors(sqlErrors, _localizer);
        }