Пример #1
0
        private void Initialise(SIPEntitiesDomainContext riaContext)
        {
            if (riaContext.SIPDomains.Count() == 0)
            {
                var query = riaContext.GetSIPDomainsQuery().OrderBy(x => x.Domain).Skip(0).Take(MAX_RIA_LIST_SIZE);
                query.IncludeTotalCount = true;
                riaContext.Load(query, LoadBehavior.RefreshCurrent, (lo) => { LogActivityMessage(MessageLevelsEnum.Info, lo.TotalEntityCount + " domains successfully loaded."); }, null);
            }

            if (riaContext.SIPDialPlans.Count() == 0)
            {
                var query = riaContext.GetSIPDialplansQuery().OrderBy(x => x.DialPlanName).Skip(0).Take(MAX_RIA_LIST_SIZE);
                query.IncludeTotalCount = true;
                riaContext.Load(query, LoadBehavior.RefreshCurrent, (lo) => { LogActivityMessage(MessageLevelsEnum.Info, lo.TotalEntityCount + " dialplans successfully loaded."); }, null);
            }

            if (riaContext.SIPProviders.Count() == 0)
            {
                var query = riaContext.GetSIPProvidersQuery().OrderBy(x => x.ProviderName).Skip(0).Take(MAX_RIA_LIST_SIZE);
                query.IncludeTotalCount = true;
                riaContext.Load(query, LoadBehavior.RefreshCurrent, (lo) => { LogActivityMessage(MessageLevelsEnum.Info, lo.TotalEntityCount + " providers successfully loaded."); }, null);
            }
        }