C# .Net Core WebAPI Cyclic Dependancy
Hello, trying to make simple web api, have two classes Character and Episode both classes has nav property to other, wit ManyToMany relationship.
The problem is when i trying to Get data json data looks like this;
[
{
"name": "Pika",
"status": "asdasd",
"species": "adasd",
"gender": "Male",
"image": "adsas",
"episodes": [
{
"name": "EP1",
"airDate": "22323",
"episodeCode": "asdadEP",
"characters": [
null
],
"id": 1,
"createdAt": "2024-03-03T18:40:23"
}
],
"id": 3,
"createdAt": "2024-03-03T17:49:17"
}
]
Here is my entites
public class Character : BaseEntity<long>
{
...SomeProps
public ICollection<Episode> Episodes { get; set; }
}
public class Episode : BaseEntity<long>
{
...SomeProps
public virtual ICollection<Character> Characters { get; set; }
}
3 Replies