Exemplo n.º 1
0
        public async Task <IHttpActionResult> Post(Widget w)
        {
            var ir = new InternalRepresentationOfWidget(w);
            await _businessRules.ValidateAndThrowAsync(ir).ConfigureAwait(false);

            return(Ok(w));
        }
Exemplo n.º 2
0
        public OperationResult Post(Widget w)
        {
            var ir = new InternalRepresentationOfWidget(w);

            _validator.ValidateAndThrow(ir);
            return(new OperationResult.OK(new object()));
        }