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

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

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