PhantomRow
PhantomRow
CC#
Created by randombev on 11/16/2023 in #help
✅ How to create a database for an application on mac?
You can try Mssql management studio for mac? Setup? Maybe ? for mssql tsql
62 replies
CC#
Created by Fatihtopcu on 10/12/2023 in #help
❔ Taghelpers
First could be YourProjectName.OptionalExtraFolderName.Areas.AreaName.Pages
9 replies
CC#
Created by Fatihtopcu on 10/12/2023 in #help
❔ Taghelpers
3rd line is yourPrrojectName(ex. AuthoringTagHelpers)
9 replies
CC#
Created by Fatihtopcu on 10/12/2023 in #help
❔ Taghelpers
Add thatvto _ViewImports.cshtml
9 replies
CC#
Created by Fatihtopcu on 10/12/2023 in #help
❔ Taghelpers
Add this
9 replies
CC#
Created by Fatihtopcu on 10/12/2023 in #help
❔ Taghelpers
@using AuthoringTagHelpers @addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, AuthoringTagHelpers
9 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
I didn't manage to not have attribute name values escaped in string "attributeName", tried with naming policy
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
i managed to write converters using system.text.json, so now it works , my previous converter was newtonsoft, somehow json method uses text.json
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
,
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
the reason seems to be json function uses text json, and I implemented read write in newtonsoft
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
this was solution
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
JToken token = JToken.Load(reader); if (token.Type == JTokenType.Array) { // If it's an array, deserialize as a LinkArray. var linkArray = new LinkArray { Elements = token.ToObject<List<Link>>() }; return linkArray; } else if (token.Type == JTokenType.Object) { // If it's an object, deserialize as a LinkElement. return token.ToObject<LinkElement>(); }
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
When I do return Json(result), I get link:{} -and I should get { atr1:value1} or [{atr1:val1,atr2:val2}], Values are there in result, and I can serializeObject to string and have attributes there Any idea why am I missing link properties values? -how to get them?
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
that should help, I solved it in similar way, but you are lifesaver because if I didn't this would be everything, so you are MVP , thank you ❤️
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
I have Entry class, I want to deserialize Entry class, Entry class has attribute link that can be both type Link and List<Link>, I provided in the fiddle best I could do. Only workaround that I can think of is using try catch where I create class Entry1 that has Link link attribute and Entry2 that has List<Link> link attribute. Any other suggestion. I've read your link it somehow didn't help me.
16 replies
CC#
Created by PhantomRow on 10/9/2023 in #help
❔ Deserialize Object that can have both Array and Object structure
if (reader.TokenType == JsonToken.StartArray) { return serializer.Deserialize<LinkArray>(reader); } else if (reader.TokenType == JsonToken.StartObject) { return serializer.Deserialize<LinkElement>(reader); } else { throw new JsonSerializationException("Unexpected token type when deserializing 'link'."); } this doesn't work either
16 replies