private void GetRules(int offset, int count, AssetViewPanel panel, SIPCallDirection ruleDirection) { if (!m_routesPanelRefreshInProgress) { m_routesPanelRefreshInProgress = true; m_riaContext.SimpleWizardRules.Clear(); var routesQuery = m_riaContext.GetSimpleWizardRulesQuery().Where(x => x.DialPlanID == m_dialPlan.ID && x.Direction == ruleDirection.ToString()).OrderBy(x => x.Priority).Skip(offset).Take(count); routesQuery.IncludeTotalCount = true; m_riaContext.Load <SimpleWizardRule>(routesQuery, LoadBehavior.RefreshCurrent, RulesLoaded, panel); } }