Exemplo n.º 1
0
        public bool LoadFromStore(IDocumentSession session)
        {
            redirectsTable = session.Load <RedirectsTable>(Constants.RedirectsTableDocumentId);

            var d = session.Load <IDictionary <string, AreaConfigs> >(Constants.AreasDocumentName);

            if (d == null)
            {
                return(false);
            }

            AreasByRoute.Clear();
            foreach (var areaConfig in d)
            {
                RegisterArea(areaConfig.Key, areaConfig.Value);
            }

            return(true);
        }
Exemplo n.º 2
0
 public void AddRedirect(string requestPath, RedirectsTable.RedirectCommand redirectCommand)
 {
     redirectsTable = redirectsTable ?? new RedirectsTable();
     redirectsTable.theTable.Add(requestPath.Length > 1 ? requestPath.TrimEnd(new[] { '/', ' ' }) : requestPath, redirectCommand);
 }
Exemplo n.º 3
0
 public void AddRedirect(string requestPath, RedirectsTable.RedirectCommand redirectCommand)
 {
     redirectsTable = redirectsTable ?? new RedirectsTable();
     redirectsTable.theTable.Add(requestPath.Length > 1 ? requestPath.TrimEnd(new[] { '/', ' ' }) : requestPath, redirectCommand);
 }
Exemplo n.º 4
0
        public bool LoadFromStore(IDocumentSession session)
        {
            redirectsTable = session.Load<RedirectsTable>(Constants.RedirectsTableDocumentId);

            var d = session.Load<IDictionary<string, AreaConfigs>>(Constants.AreasDocumentName);
            if (d == null) return false;

            AreasByRoute.Clear();
            foreach (var areaConfig in d)
            {
                RegisterArea(areaConfig.Key, areaConfig.Value);
            }

            return true;
        }