コード例 #1
0
        public async Task <IHttpActionResult> Post(Widget w)
        {
            var ir = new InternalRepresentationOfWidget(w);
            await _businessRules.ValidateAndThrowAsync(ir).ConfigureAwait(false);

            return(Ok(w));
        }
コード例 #2
0
        public OperationResult Post(Widget w)
        {
            var ir = new InternalRepresentationOfWidget(w);

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