I am creting API for working with JSON input and storing. This is json format that I need to insert:
{
"user_id": 1,
"amount": 1,
"paging": {
"skip": 6,
"take": 10
},
"name": "Test"
}
It stores "paging" as null. Here is my c# code:
{
public class TodoItem
{
[Key]
public long User_id { get; set; }
public int Amount { get; set; }
public Paging Paging { get; set; }
public string Name { get; set; }
}
public class Paging
{
[Key]
public int Skip { get; set; }
public int Take { get; set; }
}
}
I was getting an error until I did not put [Key] tags, but I think something is wrong with that as well. Thank you!