Esempio n. 1
0
        public ActionResult Read(bool boolShowAllEmployee, int numberofReturnedEmployee = 0)
        {
            //StsContext db = new StsContext();
            //جهت غیر فعال کردن لود فرزندان و در نتیجه جلوگیری از ایجاد حلقه
            //db.Configuration.ProxyCreationEnabled = false;
            //var a = GenerateEmployeeList(boolShowAllEmployee);
            IEnumerable <EmployeesDetailViewModel> result;

            if (boolShowAllEmployee == true)
            {
                result = _employeeDetailService.GetAll();
            }
            else
            {
                result = _employeeDetailService.GetFew(numberofReturnedEmployee);
            }
            return(Json(result, JsonRequestBehavior.AllowGet));
        }