Example #1
0
        public static IOAuthRemoteServerAccount GetOAuthAccount(this IEntitySession session, string serverName, string accountName = null)
        {
            if (accountName == null)
            {
                var stt = session.GetOAuthSettings();

                accountName = stt.DefaultAccountName;
            }
            var accountQuery = session.EntitySet <IOAuthRemoteServerAccount>().Where(a => a.Server.Name == serverName && a.Name == accountName);
            var act          = accountQuery.FirstOrDefault();

            return(act);
        }