public JsonResult GetTablesByModuleID(int subModuleID) { IGumruk iGumruk = new BSGumruk(); List <ModuleOperation> operationsResponse = new List <ModuleOperation>(); List <d_b_tables> listTables = iGumruk.GetTablesBySubModuleID(subModuleID); foreach (var op in listTables) { if (operationsResponse.Where(p => p.schema_name == op.d_b_schemas.name && p.table_name == op.name).FirstOrDefault() == null) { operationsResponse.Add(new ModuleOperation("", "", op.id, op.name, op.d_b_schemas.name)); } } return(Json(operationsResponse.OrderBy(p => p.schema_name), JsonRequestBehavior.AllowGet)); }