© 2026 Hedgehog Software, LLC

TwitterGitHubDiscord
More
CommunitiesDocsAboutTermsPrivacy
Search
Star
Setup for Free
C#C
C#•3y ago•
81 replies
neSHa

❔ i cant return object in JSON correctly in asp.net core web app

i cant serialize object correctly, so im creating asp.net core web app, and i have model structured kie this:

public class Card
{
[Key]
public int Id { get; set; }

public string Name { get; set; }

public string Description { get; set; }

public double Price { get; set; }
public double Price2 { get; set; }
public double Price3 { get; set; }
public double Price4 { get; set; }
public double MorePrices { get; set; }

[ValidateNever]
public string Image { get; set; }

public int Amount { get; set; }

[ValidateNever]
public int? CardId { get; set; }
[ForeignKey("CardId")]
[ValidateNever]
public Card Parent { get; set; }

[ValidateNever]
public int TypeId { get; set; }
[ForeignKey("TypeId")]
[ValidateNever]
public Type Type { get; set; }

[ValidateNever]
public DateTime Created_at { get; set; }
[ValidateNever]
public DateTime Updated_at { get; set; }

[ValidateNever]
[NotMapped]
public List<Card>? Appendices { get; set; }


}


and i have API that pull this this item from db, and populate appendices with items that have CardId equals to id of this exec item. Now api returns that object in JSON, and i got completly unreadable JSON format, i use JSON formatter on chrome but it wont format it as other objects without Appendices. i tried fetching it but it wont. What i am doing wrong?
C# banner
C#Join
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
61,871Members
Resources

Similar Threads

Was this page helpful?
Recent Announcements
Next page

Similar Threads

❔ ASP.NET Core web app vs ASP.net web application(.NET Framework)
C#CC# / help
4y ago
✅ ASP.NET CORE with React.js or ASP.NET CORE WEB APP
C#CC# / help
3y ago
✅ ASP.Net Core Web API
C#CC# / help
6mo ago
✅ ASP.NET CORE Web Application
C#CC# / help
15mo ago