public JsonResult Create(TeamIM team) { if (!ModelState.IsValid) { AR.Setfailure(GetModelErrorMessage()); return(Json(AR, JsonRequestBehavior.DenyGet)); } try { var newTeam = _mapper.Map <TeamIM, Team>(team); var result = _teamServices.Create(newTeam); int count; int pageSize = SettingsManager.Team.PageSize; var list = _teamServices.GetTeamdElements(0, pageSize, string.Empty, out count); AR.Data = RenderPartialViewToString("_TeamList", list); AR.SetSuccess(String.Format(Messages.AlertCreateSuccess, EntityNames.Team)); return(Json(AR, JsonRequestBehavior.DenyGet)); } catch (Exception er) { AR.Setfailure(er.Message); return(Json(AR, JsonRequestBehavior.DenyGet)); } }