public DataResult <int> CreateTwoFactorTokenForUser(UserModel user, string provider, string token) { var now = m_dateTimeProvider.UtcNow; var twoFactorLoginEntity = new TwoFactorLoginEntity { TokenProvider = provider, Token = token, CreateTime = now, }; try { var result = m_userUoW.CreateTwoFactorTokenForUser(user.Id, twoFactorLoginEntity); return(Success(result)); } catch (DatabaseException e) { m_logger.LogWarning(e); return(Error <int>(e.Message)); } }