public async Task <IActionResult> Find([FromBody] List <ObjectId> fieldIds)
 {
     return(await FunctionWrapper.ExecuteFunction(this, async() =>
     {
         return await _fieldRepository.Find(fieldIds);
     }));
 }
Пример #2
0
        public async Task <bool> Add(Field field)
        {
            if (!ExecuteValidation(new FieldValidation(), field))
            {
                return(false);
            }

            if (_fieldRepository.Find(f => f.Name == field.Name).Result.Any())
            {
                Notify("Já existe outra área com esse nome");
                return(false);
            }

            await _fieldRepository.Add(field);

            return(true);
        }