Exemplo n.º 1
0
 public override async Task ValidateAsync(ProcessingRequest <TModelType> request)
 {
     if (_repo.GetItem <TModelType>(m => m.Id == request.Item.Id)?.Id == null)
     {
         request.AddValidationMessage($"Object not found by id of type {typeof(TModelType)}",
                                      ProcessingMessageType.ValidationError);
     }
 }
Exemplo n.º 2
0
 public override async Task ValidateAsync(ProcessingRequest <TModel> request)
 {
     if (request.Item.PlayerId != null)
     {
         await Task.Run(() => request.AddValidationMessage(
                            $"Requested objects to create must have null Ids.",
                            ProcessingMessageType.ValidationError));
     }
 }