Exemplo n.º 1
0
        public override async Task <bool> TryUpdateModelAsync <TModel>(TModel model)
        {
            if (await base.TryUpdateModelAsync(model))
            {
                await BindAttributeRunner.BindOn(this, (IViewModel)model);

                return(true);
            }

            return(false);
        }
Exemplo n.º 2
0
        public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
        {
            await BindAttributeRunner.Run(context);

            if (!await AuthorizeRequestParams(context))
            {
                context.Result = Unauthorized();
            }
            else
            {
                await base.OnActionExecutionAsync(context, next);
            }
        }
Exemplo n.º 3
0
        public override async Task <bool> TryUpdateModelAsync <TModel>(TModel model)
        {
            var result = await base.TryUpdateModelAsync(model);

            try
            {
                await BindAttributeRunner.Bind(model as IViewModel, this);
            }
            catch
            {
                return(false);
            }

            return(result);
        }
Exemplo n.º 4
0
        /// <summary>
        /// Creates a new instance of the specified view model type and binds it using the standard request data.
        /// </summary>

        public override async Task OnActionExecutionAsync(ActionExecutingContext context, ActionExecutionDelegate next)
        {
            await BindAttributeRunner.Run(context, next);

            await base.OnActionExecutionAsync(context, next);
        }