Exemplo n.º 1
0
        public virtual async Task <ActionResult> Create(AddEducationalBackgroundViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(new JsonNetResult
                {
                    Data = new
                    {
                        success = false,
                        View = this.RenderPartialViewToString(MVC.EducationalBackground.Views._Create, viewModel)
                    }
                });
            }
            var newbackground = await _educationalBackgroundService.Create(viewModel);

            return(new JsonNetResult
            {
                Data = new
                {
                    success = true,
                    View = this.RenderPartialViewToString(MVC.EducationalBackground.Views._EducationalBackgroundItem, newbackground)
                }
            });
        }