Exemplo n.º 1
0
        /// <summary>
        /// Creates a new API on an already open session.
        /// </summary>
        /// <param name="session">The session</param>
        internal Api(Data.ISession session)
        {
            this.session = session != null ? session : App.Store.OpenSession();
            isExternal   = session != null;

            Aliases    = new Repositories.AliasRepository(this.session);
            Authors    = new Repositories.AuthorRepository(this.session);
            Blocks     = new Repositories.BlockRepository(this.session);
            Categories = new Repositories.CategoryRepository(this.session);
            Comments   = new Repositories.CommentRepository(this.session);
            Media      = new Repositories.MediaRepository(this.session);
            Pages      = new Repositories.PageRepository(this.session);
            PageTypes  = new Repositories.PageTypeRepository(this.session);
            Params     = new Repositories.ParamRepository(this.session);
            Posts      = new Repositories.PostRepository(this.session);
            PostTypes  = new Repositories.PostTypeRepository(this.session);
            Ratings    = new Repositories.RatingRepository(this.session);
        }