0

I have a class that looks like this

public class ClassA
{
   [JsonProperty(Required = Required.Always)]
   public int variable1{get;set}

   [JsonProperty(Required = Required.Always)]
   public ClassB variable2{get;set;}
}

And Class B looks like this

public class classB
{
    [JsonProperty(Required = Required.Always)]
    int variable3{get;set}

    [JsonProperty(Required = Required.Always)]
    ClassC variable4{get;set}

}

Since i am referring Class B type in this class, is this still considered as a poco class?

Harshith R
  • 418
  • 1
  • 11
  • 31
  • Very much based on your opinion of a) how you define a poco and/or b) whether you class any data model as poco so long as the serialiser can serialise it. – Meirion Hughes Feb 14 '20 at 10:01
  • What does the ```ClassB``` look like? If it's a POCO class as well, you're good to go. – devsmn Feb 14 '20 at 10:02
  • See : https://stackoverflow.com/questions/250001/poco-definition – PaulF Feb 14 '20 at 10:03
  • @Shawn, I have updated how my ClassB looks like – Harshith R Feb 14 '20 at 10:06
  • 1
    Originally I would have said yes however since your update, you are using `JsonProperty` which is iirc from JSON.Net meaning that you do depend on an external framework and so they wouldn't qualify as POCOs. – Stephen Byrne Feb 14 '20 at 10:10

0 Answers0