nathanAjacobs
nathanAjacobs
CC#
Created by nathanAjacobs on 11/4/2024 in #help
Deep copying data from class instances
I got it working with MemoryPack.
public static class OverwriteUtility
{
[ThreadStatic]
private static readonly ArrayBufferWriter<byte> buffer = new();

public static void Overwrite<T>(in T from, ref T to)
{
buffer.Clear();
MemoryPackSerializer.Serialize(buffer, from);
MemoryPackSerializer.Deserialize(buffer.WrittenSpan, ref to);
}
}
public static class OverwriteUtility
{
[ThreadStatic]
private static readonly ArrayBufferWriter<byte> buffer = new();

public static void Overwrite<T>(in T from, ref T to)
{
buffer.Clear();
MemoryPackSerializer.Serialize(buffer, from);
MemoryPackSerializer.Deserialize(buffer.WrittenSpan, ref to);
}
}
14 replies
CC#
Created by nathanAjacobs on 11/4/2024 in #help
Deep copying data from class instances
Something similar probably, I need to deserialize into existing instance of the type
14 replies
CC#
Created by nathanAjacobs on 11/4/2024 in #help
Deep copying data from class instances
Nothing, I'm just not aware of one / never tested it. I have to experiment and find one
14 replies
CC#
Created by nathanAjacobs on 11/4/2024 in #help
Deep copying data from class instances
Yeah I don't want to have to implement it per class. I guess serializing and deserializing will work. I just need a serializer that supports deserializing into existing instances all the way down the type tree
14 replies
CC#
Created by nathanAjacobs on 10/23/2024 in #help
Aspire and PgAdmin
I'm using Docker Desktop and tried both with and without WSL
3 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
And again I have no idea why that for loop fixes it, I would think if anything it would make it worse
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Yeah you might be right in that the UI framework is doing something behind the scenes to get the text ready for the screen without blocking the UI thread. It's strange that they would hold off other button clicks though while that's happening
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
The code for when that button is clicked
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
That's very strange, can you show the code
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
So you're saying if you add button to the page and click it, the button handler code doesn't get executed until after the text loads?
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
I thought that is the code when the page loads. I thought you said there was a button on the page that you can click while the text is loading
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
It is setting the entire text on the last iteration of the for loop
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Can you show the code of the button click. I don't see how that for loop will solve it either. On the last iteration of the for loop it is literally the same as what you had before
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
To me this would mean that your UI is responsive while it's loading not frozen, since you can still click and type things
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
What will only appear, what you typed? I don't see the problem. What are you trying to solve? Are you trying to prevent the user from clicking buttons while it's loading?
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Okay I'm unsure then why it would freeze. What do you mean by freeze until it can modify
58 replies
CC#
Created by Bubba on 10/6/2024 in #help
Async issue
Are you still using Task.Run() to call this method?
58 replies
CC#
Created by nathanAjacobs on 10/7/2024 in #help
✅ Can you run EF Core migration update at application startup rather than with the CLI tools?
Gotcha, awesome!
8 replies
CC#
Created by nathanAjacobs on 10/7/2024 in #help
✅ Can you run EF Core migration update at application startup rather than with the CLI tools?
So I would just call that when configuring services or what?
8 replies
CC#
Created by nathanAjacobs on 10/7/2024 in #help
✅ Can you run EF Core migration update at application startup rather than with the CLI tools?
Thanks!!!
8 replies