1

Following is my code snippet.

public class MyModelClass
{
    public Matter Matter {get;set;}   // where Matter is json
}

public class Matter
{
    public List<Issue> Issues {get;set;} // list i want to convert on base of types
}

public class Issue
{
}

public class Issue1:Issue
{
}

public class Issue2:Issue
{
}

public class Issue3:Issue
{
}

I have already found solution for json field conversion but I need to do for nested.

Hammad Sajid
  • 312
  • 1
  • 3
  • 14
  • What i understands from your question you want to make a class using which can automatically filled it's JSON into your Class object? – Hammad Sajid Jan 21 '20 at 07:07
  • Yes something like that . I want Issues list of Issue containing objects of different issue types like Issue1,Issue2 and Issue3 not List of Issue when i retrieve it from database saved in json field. – Sammi Ullah Jan 21 '20 at 09:11

1 Answers1

0

as I understand that you need to make the model recognize the nested JSON objects, the only way to work with is to define it like that :

public List<type> Issues { get; set; }
Aziz Alzayed
  • 236
  • 5
  • 17