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

            Consensus.Security.IUserAccountModel model = provider.Security.UserAccount.FetchById(id);
            return(model == null ? null : new Consensus.Security.UserAccount(model));
        }
예제 #2
0
        /// <summary>
        ///     Creates a new <see cref="!:UserAccountModel" /> instance.
        /// </summary>
        /// <returns>
        ///     A newly instantiated <see cref="!:UserAccountModel" /> instance.
        /// </returns>
        public static Consensus.Security.UserAccount Create(ConsensusSite site)
        {
            IBusinessProvider provider = site.GetService <IBusinessProvider>();

            Consensus.Security.IUserAccountModel model = provider.Security.UserAccount.Create();
            return(model == null ? null : new Consensus.Security.UserAccount(model));
        }