using System.Collections.Generic;
using Newtonsoft.Json.Linq;
public static void Main()
""numContract"": ""123456"",
var investPortfolioDto = JsonConvert.DeserializeObject<InvestmentTaxDeductionGetYearsResponse>(json);
Console.WriteLine(investPortfolioDto.Contracts.ElementAt(0).Years == null);
public sealed class InvestmentTaxDeductionGetYearsResponse
public string Code { get; set; }
[JsonProperty("contracts")]
public List<IIStoYearsResponseDTO> Contracts { get; set; }
public sealed class IIStoYearsResponseDTO
[JsonProperty("numContract")]
public string NumContract { get; set; }
public List<int> Years { get; set; }