//------------------- Delete by keywords --------------------------------------------------------

        /// <summary>
        /// Delete all  Authentication Session data with authentication Session String containing specified keyword
        /// </summary>
        /// <param name="authenticationSessionString"> Authentication Session String</param>
        /// <returns>List of  Authentication Session</returns>
        public void DeleteByAuthenticationSessionString(string authenticationSessionString)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AuthenticationSessions
                       where
                       o.AuthenticationSessionString.Contains(authenticationSessionString)
                       select o;

            dataContext.AuthenticationSessions.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Authentication Session data with session Expired Date containing specified keyword
        /// </summary>
        /// <param name="sessionExpiredDate"> Session Expired Date</param>
        /// <returns>List of  Authentication Session</returns>
        public void DeleteBySessionExpiredDate(DateTime sessionExpiredDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AuthenticationSessions
                       where
                       o.SessionExpiredDate.Equals(sessionExpiredDate)
                       select o;

            dataContext.AuthenticationSessions.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Refresh Token data with authentication Code containing specified keyword
        /// </summary>
        /// <param name="authenticationCode"> Authentication Code</param>
        /// <returns>List of  Refresh Token</returns>
        public void DeleteByAuthenticationCode(string authenticationCode)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RefreshTokens
                       where
                       o.AuthenticationCode.Contains(authenticationCode)
                       select o;

            dataContext.RefreshTokens.RemoveRange(list);
            dataContext.SaveChanges();
        }
Пример #4
0
        /// <summary>
        /// Delete all  Access Token data with client Secret containing specified keyword
        /// </summary>
        /// <param name="clientSecret"> Client Secret</param>
        /// <returns>List of  Access Token</returns>
        public void DeleteByClientSecret(string clientSecret)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AccessTokens
                       where
                       o.ClientSecret.Contains(clientSecret)
                       select o;

            dataContext.AccessTokens.RemoveRange(list);
            dataContext.SaveChanges();
        }
Пример #5
0
        /// <summary>
        /// Delete all  O Auth Setting data with setting Value containing specified keyword
        /// </summary>
        /// <param name="settingValue"> Setting Value</param>
        /// <returns>List of  O Auth Setting</returns>
        public void DeleteBySettingValue(string settingValue)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.OAuthSettings
                       where
                       o.SettingValue.Contains(settingValue)
                       select o;

            dataContext.OAuthSettings.RemoveRange(list);
            dataContext.SaveChanges();
        }
Пример #6
0
        /// <summary>
        /// Delete all  Authentication Source data with authentication Classname containing specified keyword
        /// </summary>
        /// <param name="authenticationClassname"> Authentication Classname</param>
        /// <returns>List of  Authentication Source</returns>
        public void DeleteByAuthenticationClassname(string authenticationClassname)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AuthenticationSources
                       where
                       o.AuthenticationClassname.Contains(authenticationClassname)
                       select o;

            dataContext.AuthenticationSources.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Registered Application data with client I D containing specified keyword
        /// </summary>
        /// <param name="clientID"> Client I D</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByClientID(string clientID)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.ClientID.Contains(clientID)
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
Пример #8
0
        /// <summary>
        /// Delete all  Access Token data with refresh Token containing specified keyword
        /// </summary>
        /// <param name="refreshToken"> Refresh Token</param>
        /// <returns>List of  Access Token</returns>
        public void DeleteByRefreshToken(string refreshToken)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AccessTokens
                       where
                       o.RefreshToken.Contains(refreshToken)
                       select o;

            dataContext.AccessTokens.RemoveRange(list);
            dataContext.SaveChanges();
        }
Пример #9
0
//------------------- Delete by keywords --------------------------------------------------------

        /// <summary>
        /// Delete all  Access Token data with access Token String containing specified keyword
        /// </summary>
        /// <param name="accessTokenString"> Access Token String</param>
        /// <returns>List of  Access Token</returns>
        public void DeleteByAccessTokenString(string accessTokenString)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AccessTokens
                       where
                       o.AccessTokenString.Contains(accessTokenString)
                       select o;

            dataContext.AccessTokens.RemoveRange(list);
            dataContext.SaveChanges();
        }
//-----------------------  Delete by Foreign keys ---------------------------------------

        /// <summary>
        /// Delete all  Registered Application data with specified authentication Source Id
        /// </summary>
        /// <param name="authenticationSourceId"> Authentication Source Id</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByAuthenticationSourceId(Int16 authenticationSourceId)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.AuthenticationSourceId == authenticationSourceId
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Registered Application data with specified is Active
        /// </summary>
        /// <param name="isActive"> Is Active</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByIsActive(Int16 isActive)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IsActive == isActive
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Registered Application data with authentication Url containing specified keyword
        /// </summary>
        /// <param name="authenticationUrl"> Authentication Url</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByAuthenticationUrl(string authenticationUrl)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.AuthenticationUrl.Contains(authenticationUrl)
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Registered Application data with created Date containing specified keyword
        /// </summary>
        /// <param name="createdDate"> Created Date</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByCreatedDate(DateTime createdDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.CreatedDate.Equals(createdDate)
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Registered Application data with application Desc containing specified keyword
        /// </summary>
        /// <param name="applicationDesc"> Application Desc</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByApplicationDesc(string applicationDesc)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.ApplicationDesc.Contains(applicationDesc)
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Delete all  Registered Application data with access Token Redirect U R I containing specified keyword
        /// </summary>
        /// <param name="accessTokenRedirectURI"> Access Token Redirect U R I</param>
        /// <returns>List of  Registered Application</returns>
        public void DeleteByAccessTokenRedirectURI(string accessTokenRedirectURI)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.AccessTokenRedirectURI.Contains(accessTokenRedirectURI)
                       select o;

            dataContext.RegisteredApplications.RemoveRange(list);
            dataContext.SaveChanges();
        }
Пример #16
0
        /// <summary>
        /// Delete all  Access Token data with expired Date containing specified keyword
        /// </summary>
        /// <param name="expiredDate"> Expired Date</param>
        /// <returns>List of  Access Token</returns>
        public void DeleteByExpiredDate(DateTime expiredDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AccessTokens
                       where
                       o.ExpiredDate.Equals(expiredDate)
                       select o;

            dataContext.AccessTokens.RemoveRange(list);
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Authentication Code's id Authentication Code, authorization Session I D by idAuthenticationCode
        /// </summary>
        /// <param name="idAuthenticationCode">id Authentication Code</param>
        /// <param name="authorizationSessionID">authorization Session I D</param>
        /// <returns>List of  Authentication Code</returns>
        public void UpdateAuthorizationSessionID(Int64 idAuthenticationCode, string authorizationSessionID)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AuthenticationCodes
                       where
                       o.IdAuthenticationCode == idAuthenticationCode
                       select o;

            list.ToList().ForEach(o => {
                o.AuthorizationSessionID = authorizationSessionID;
            });
            dataContext.SaveChanges();
        }
Пример #18
0
        /// <summary>
        /// Updates  Registered Application's id Application, application Desc by idApplication
        /// </summary>
        /// <param name="idApplication">id Application</param>
        /// <param name="applicationDesc">application Desc</param>
        /// <returns>List of  Registered Application</returns>
        public void UpdateApplicationDesc(Int16 idApplication, string applicationDesc)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IdApplication == idApplication
                       select o;

            list.ToList().ForEach(o => {
                o.ApplicationDesc = applicationDesc;
            });
            dataContext.SaveChanges();
        }
Пример #19
0
//-------------------------- Update foreign keys -----------------------------------------

        /// <summary>
        /// Updates  Registered Application's id Application, authentication Source Id by idApplication
        /// </summary>
        /// <param name="idApplication">id Application</param>
        /// <param name="authenticationSourceId">authentication Source Id</param>
        /// <returns>List of  Registered Application</returns>
        public void UpdateAuthenticationSourceId(Int16 idApplication, Int16 authenticationSourceId)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IdApplication == idApplication
                       select o;

            list.ToList().ForEach(o => {
                o.AuthenticationSourceId = authenticationSourceId;
            });
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Refresh Token's id Refresh Token, expired Date by idRefreshToken
        /// </summary>
        /// <param name="idRefreshToken">id Refresh Token</param>
        /// <param name="expiredDate">expired Date</param>
        /// <returns>List of  Refresh Token</returns>
        public void UpdateExpiredDate(Int64 idRefreshToken, DateTime expiredDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RefreshTokens
                       where
                       o.IdRefreshToken == idRefreshToken
                       select o;

            list.ToList().ForEach(o => {
                o.ExpiredDate = expiredDate;
            });
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Refresh Token's id Refresh Token, refresh Token String by idRefreshToken
        /// </summary>
        /// <param name="idRefreshToken">id Refresh Token</param>
        /// <param name="refreshTokenString">refresh Token String</param>
        /// <returns>List of  Refresh Token</returns>
        public void UpdateRefreshTokenString(Int64 idRefreshToken, string refreshTokenString)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RefreshTokens
                       where
                       o.IdRefreshToken == idRefreshToken
                       select o;

            list.ToList().ForEach(o => {
                o.RefreshTokenString = refreshTokenString;
            });
            dataContext.SaveChanges();
        }
Пример #22
0
        /// <summary>
        /// Updates  O Auth Setting's id O Auth Setting, setting Value by idOAuthSetting
        /// </summary>
        /// <param name="idOAuthSetting">id O Auth Setting</param>
        /// <param name="settingValue">setting Value</param>
        /// <returns>List of  O Auth Setting</returns>
        public void UpdateSettingValue(Int16 idOAuthSetting, string settingValue)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.OAuthSettings
                       where
                       o.IdOAuthSetting == idOAuthSetting
                       select o;

            list.ToList().ForEach(o => {
                o.SettingValue = settingValue;
            });
            dataContext.SaveChanges();
        }
Пример #23
0
        /// <summary>
        /// Updates  Registered Application's id Application, client I D by idApplication
        /// </summary>
        /// <param name="idApplication">id Application</param>
        /// <param name="clientID">client I D</param>
        /// <returns>List of  Registered Application</returns>
        public void UpdateClientID(Int16 idApplication, string clientID)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IdApplication == idApplication
                       select o;

            list.ToList().ForEach(o => {
                o.ClientID = clientID;
            });
            dataContext.SaveChanges();
        }
Пример #24
0
        /// <summary>
        /// Updates  Registered Application's id Application, access Token Redirect U R I by idApplication
        /// </summary>
        /// <param name="idApplication">id Application</param>
        /// <param name="accessTokenRedirectURI">access Token Redirect U R I</param>
        /// <returns>List of  Registered Application</returns>
        public void UpdateAccessTokenRedirectURI(Int16 idApplication, string accessTokenRedirectURI)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IdApplication == idApplication
                       select o;

            list.ToList().ForEach(o => {
                o.AccessTokenRedirectURI = accessTokenRedirectURI;
            });
            dataContext.SaveChanges();
        }
Пример #25
0
        /// <summary>
        /// Updates  Registered Application's id Application, created Date by idApplication
        /// </summary>
        /// <param name="idApplication">id Application</param>
        /// <param name="createdDate">created Date</param>
        /// <returns>List of  Registered Application</returns>
        public void UpdateCreatedDate(Int16 idApplication, DateTime createdDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IdApplication == idApplication
                       select o;

            list.ToList().ForEach(o => {
                o.CreatedDate = createdDate;
            });
            dataContext.SaveChanges();
        }
Пример #26
0
        /// <summary>
        /// Updates  Registered Application's id Application, is Active by idApplication
        /// </summary>
        /// <param name="idApplication">id Application</param>
        /// <param name="isActive">is Active</param>
        /// <returns>List of  Registered Application</returns>
        public void UpdateIsActive(Int16 idApplication, Int16 isActive)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RegisteredApplications
                       where
                       o.IdApplication == idApplication
                       select o;

            list.ToList().ForEach(o => {
                o.IsActive = isActive;
            });
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Refresh Token's id Refresh Token, authentication Code by idRefreshToken
        /// </summary>
        /// <param name="idRefreshToken">id Refresh Token</param>
        /// <param name="authenticationCode">authentication Code</param>
        /// <returns>List of  Refresh Token</returns>
        public void UpdateAuthenticationCode(Int64 idRefreshToken, string authenticationCode)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RefreshTokens
                       where
                       o.IdRefreshToken == idRefreshToken
                       select o;

            list.ToList().ForEach(o => {
                o.AuthenticationCode = authenticationCode;
            });
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Authentication Code's id Authentication Code, expired Date by idAuthenticationCode
        /// </summary>
        /// <param name="idAuthenticationCode">id Authentication Code</param>
        /// <param name="expiredDate">expired Date</param>
        /// <returns>List of  Authentication Code</returns>
        public void UpdateExpiredDate(Int64 idAuthenticationCode, DateTime expiredDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AuthenticationCodes
                       where
                       o.IdAuthenticationCode == idAuthenticationCode
                       select o;

            list.ToList().ForEach(o => {
                o.ExpiredDate = expiredDate;
            });
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Refresh Token's id Refresh Token, client Secret by idRefreshToken
        /// </summary>
        /// <param name="idRefreshToken">id Refresh Token</param>
        /// <param name="clientSecret">client Secret</param>
        /// <returns>List of  Refresh Token</returns>
        public void UpdateClientSecret(Int64 idRefreshToken, string clientSecret)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.RefreshTokens
                       where
                       o.IdRefreshToken == idRefreshToken
                       select o;

            list.ToList().ForEach(o => {
                o.ClientSecret = clientSecret;
            });
            dataContext.SaveChanges();
        }
        /// <summary>
        /// Updates  Authentication Session's id Authentication Session, session Created Date by idAuthenticationSession
        /// </summary>
        /// <param name="idAuthenticationSession">id Authentication Session</param>
        /// <param name="sessionCreatedDate">session Created Date</param>
        /// <returns>List of  Authentication Session</returns>
        public void UpdateSessionCreatedDate(Int64 idAuthenticationSession, DateTime sessionCreatedDate)
        {
            ToolsDataContext dataContext = (ToolsDataContext)this.DataContext;
            var list = from o in dataContext.AuthenticationSessions
                       where
                       o.IdAuthenticationSession == idAuthenticationSession
                       select o;

            list.ToList().ForEach(o => {
                o.SessionCreatedDate = sessionCreatedDate;
            });
            dataContext.SaveChanges();
        }