public UserModel GetUserByUserName(string userName) { var client = GetClient(); var userRecords = client.GetObjectsWithQuery(TABLE_NAME_USER, new { twitterUserName = userName }); if (userRecords != null && userRecords.Length > 0) { var userRecord = userRecords[0]; var userModel = new UserModel { Id = ParseDataTypeConverter.ToString(userRecord[ParseTableConstants.UserTable_ColumnName_ObjectId]), TwitterUserName = ParseDataTypeConverter.ToString(userRecord[ParseTableConstants.UserTable_ColumnName_TwitterUserName]), Score = ParseDataTypeConverter.ToInt(userRecord[ParseTableConstants.UserTable_ColumnName_Score]), DateLastScored = ParseDataTypeConverter.ToNullableDateTime(userRecord[ParseTableConstants.UserTable_ColumnName_UpdatedAt]) }; return userModel; } return null; }
public static void SignUserOut() { User = null; }