Пример #1
0
        public void Add(Models.Flag model)
        {
            _validationProvider.Validate(model);

            if (!_validationProvider.HasErrors)
            {
                _repository.Add(model);
            }
        }
Пример #2
0
        public override object MutateAndGetPayload(MutationInputs inputs, ResolveFieldContext <object> context)
        {
            var audioId           = inputs.Get <int?>("audioId");
            var reason            = inputs.Get <string>("reason");
            var additionalDetails = inputs.Get <string>("additionalDetails");

            var flag = new Models.Flag
            {
                AudioId           = audioId,
                Reason            = reason,
                AdditionalDetails = additionalDetails,
            };

            _flagService.Add(flag);

            return(new
            {
                flag
            });
        }