public DataResult <int> CreateExternalLogin( int userId, string loginProvider, string providerKey ) { var externalLoginProviderEntity = m_externalLoginProviderUoW.GetExternalLoginProviderByName( loginProvider ); if (externalLoginProviderEntity.DisableManagingByUser) { const string errorMessage = "Edit this link is not permitted"; m_logger.LogWarning(errorMessage); return(Error <int>(errorMessage)); } var externalLogin = new ExternalLoginEntity { Provider = externalLoginProviderEntity, ProviderKey = providerKey }; try { var result = m_userUoW.CreateExternalLogin(userId, externalLogin); return(Success(result)); } catch (DatabaseException e) { m_logger.LogWarning(e); return(Error <int>(e.Message)); } }
public DataResult <ExternalLoginProviderModel> GetExternalLoginProvidersByName(string name) { try { var externalLoginProvider = m_externalLoginProviderUoW.GetExternalLoginProviderByName(name); return(Success( m_mapper.Map <ExternalLoginProviderModel>(externalLoginProvider) )); } catch (DatabaseException e) { m_logger.LogWarning(e); return(Error <ExternalLoginProviderModel>(e.Message)); } }