WaveBox.Core.Model.User.UpdateLastfmSession C# (CSharp) Method

UpdateLastfmSession() public method

public UpdateLastfmSession ( string sessionKey ) : bool
sessionKey string
return bool
        public bool UpdateLastfmSession(string sessionKey)
        {
            ISQLiteConnection conn = null;
            try
            {
                conn = Injection.Kernel.Get<IDatabase>().GetSqliteConnection();
                int affected = conn.Execute("UPDATE User SET LastfmSession = ? WHERE UserName = ?", sessionKey, UserName);

                if (affected > 0)
                {
                    this.LastfmSession = sessionKey;

                    return Injection.Kernel.Get<IUserRepository>().UpdateUserCache(this);
                }
            }
            catch (Exception e)
            {
                logger.Error(e);
            }
            finally
            {
                Injection.Kernel.Get<IDatabase>().CloseSqliteConnection(conn);
            }

            return false;
        }