Esempio n. 1
0
        /// <summary>
        /// Get the specific OAuthConsumer for the current application.
        /// </summary>
        /// <param name="oAuthConsumerID">The oAuthConsumerID.</param>
        /// <returns>The user; else null.</returns>
        protected Nequeo.DataAccess.CloudInteraction.Data.OAuthConsumer GetSpecificOAuthConsumers(long oAuthConsumerID)
        {
            // Get the OAuthConsumer data.
            Nequeo.DataAccess.CloudInteraction.Data.Extension.OAuthConsumer oAuthConsumerExt = new Nequeo.DataAccess.CloudInteraction.Data.Extension.OAuthConsumer();
            Nequeo.DataAccess.CloudInteraction.Data.OAuthConsumer           oAuthConsumer    = oAuthConsumerExt.Select.SelectDataEntity(u => (u.OAuthConsumerID == oAuthConsumerID));

            // Return the OAuthConsumer.
            return(oAuthConsumer);
        }
Esempio n. 2
0
        /// <summary>
        /// Insert a new OAuth consumer for the client id.
        /// </summary>
        /// <param name="clientID">The client ID associated with the OAuth consumer.</param>
        /// <returns>The OAuthConsumerID of the OAuth consumer inserted.</returns>
        protected long?InsertOAuthConsumer(long clientID)
        {
            // Insert the new OAuthConsumer.
            List <object> oAuthConsumerIDs = new Nequeo.DataAccess.CloudInteraction.Data.Extension.OAuthConsumer().Insert.InsertDataEntity(
                Nequeo.DataAccess.CloudInteraction.Data.OAuthConsumer.CreateOAuthConsumer(0, clientID));

            // Get the identities of the newly inserted item.
            if (oAuthConsumerIDs != null && oAuthConsumerIDs.Count > 0)
            {
                // Return the OAuthConsumerID value.
                return(Int64.Parse(oAuthConsumerIDs[0].ToString()));
            }

            // Return null nothing was inserted.
            return(null);
        }