示例#1
0
        /// <summary>
        ///     Retrieves a specific <see cref="!:TemplateResourceModel" /> instance.
        /// </summary>
        /// <param name="id">
        ///     The unique value which distinctly identifies the <see cref="!:TemplateResourceModel" /> instance to be returned.
        /// </param>
        /// <returns>
        ///     The <see cref="!:TemplateResourceModel" /> instance that matches the specified <paramref name="id" />; or null, if no matching instance can be found.
        /// </returns>
        public static Consensus.Learning.TemplateResource FetchById(ConsensusSite site, System.String id)
        {
            IBusinessProvider provider = site.GetService <IBusinessProvider>();

            Consensus.Learning.ITemplateResourceModel model = provider.Learning.TemplateResource.FetchById(id);
            return(model == null ? null : new Consensus.Learning.TemplateResource(model));
        }
示例#2
0
        /// <summary>
        ///     Creates a new <see cref="!:TemplateResourceModel" /> instance.
        /// </summary>
        /// <returns>
        ///     A newly instantiated <see cref="!:TemplateResourceModel" /> instance.
        /// </returns>
        public static Consensus.Learning.TemplateResource Create(ConsensusSite site)
        {
            IBusinessProvider provider = site.GetService <IBusinessProvider>();

            Consensus.Learning.ITemplateResourceModel model = provider.Learning.TemplateResource.Create();
            return(model == null ? null : new Consensus.Learning.TemplateResource(model));
        }