MCUnderground
MCUnderground
CC#
Created by MCUnderground on 5/7/2025 in #help
WPF Icon
Hello i seem to have a quite annoying issue with wpf on multiple projects. Icon for app is show on .exe normally but in task manager there is no icon. Only the child window of app has the icon? Is this known issue, any fixes?
2 replies
CC#
Created by MCUnderground on 4/12/2025 in #help
Clipboard.GetImage() handling webp.
Im trying to save copied image from clipboard to file, problem is if that image is .webp it is all black pixels. I tried pngencoder, using writablebitmap, skiasharp... I think the bitmapsource cant handle webp as Clipboard.GetImage() returns BItmapSource? Any ideas?
5 replies
CC#
Created by MCUnderground on 9/20/2024 in #help
NewtonSoft Serialization Exception
Hi i have a shared library i use on both client and server, most of JSON works fine, but in this example i have List.
Newtonsoft.Json.JsonSerializationException: Type specified in JSON 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not compatible with 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Path 'UserBoard.Items.$type', line 1, position 267.
Newtonsoft.Json.JsonSerializationException: Type specified in JSON 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not compatible with 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Path 'UserBoard.Items.$type', line 1, position 267.
11 replies
CC#
Created by MCUnderground on 9/13/2024 in #help
✅ EFCore issues when removing an entity,
Hello, so currently im having a bit of issues, im using InMemoryDB. So i have this setup where i have an Item(dynamic data) which user can change, and ItemData(static data). ItemData belongs to some ItemCollection(there are multiple item collections). Now when i combine 2 items, i remove them and create next level which i get from ItemCollection.Items, basically next index from current ItemData. Issue araises that when i combine 2 lvl 1 items everything goes smoothly, but second merge, somehow ItemData.Collection only has 2 items, like lvl 1 item got deleted, but then i created myself debug endpoint to check item collection, and it had 1st item too, so something somewhere is wrong, and i cant wrap my head around it, i am always fetching new data when checking item.
var item1 = await _context.Items.Where(i => i.Id == request.Item1Id).Include(i => i.Data).ThenInclude(d => d.Collection).FirstOrDefaultAsync();

var item2 = await _context.Items.Where(i => i.Id == request.Item2Id).Include(i => i.Data).ThenInclude(d => d.Collection).FirstOrDefaultAsync();
var item1 = await _context.Items.Where(i => i.Id == request.Item1Id).Include(i => i.Data).ThenInclude(d => d.Collection).FirstOrDefaultAsync();

var item2 = await _context.Items.Where(i => i.Id == request.Item2Id).Include(i => i.Data).ThenInclude(d => d.Collection).FirstOrDefaultAsync();
How i remove them
_context.Items.Remove(item1);
_context.Items.Remove(item2);
_context.Items.Remove(item1);
_context.Items.Remove(item2);
Keep in mind, ItemData has not reference to Item as it does not need to have, but Item has navigation to its ItemData, as it is base information about item.
8 replies