Hi @Kim Strasser , Welcome to Microsoft Q&A,
If you want to modify the IsBanned attribute directly in checkaccount, you can modify it like this:
namespace SharedCode
{
public class Game1
{
public bool IsBanned { get; set; } = false;
}
}
namespace SharedCode
{
public class MyAccount
{
private readonly Game1 _game1;
public MyAccount(Game1 game)
{
_game1 = game;
}
public async Task UpdateAsync()
{
await RandomExtensions.CheckMyAccount(_game1, ...);
}
}
}
namespace SharedCode
{
public static class RandomExtensions
{
public static async Task CheckMyAccount(Game1 game, ...)
{
// Your account checking logic here.
bool isBanned = ...;
game.IsBanned = isBanned;
}
}
}
Best Regards,
Jiale
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.