I need to expose my generic class property directly. SEE IN CODE BELOW
namespace ConsoleApp2
{
public class KTEST<T>
{
public int PageNumber { get; set; }
public int PageSize { get; set; }
public T Filter { get; set; }
}
public class Request
{
public int CountryId { get; set; }
}
class Program
{
public static void Main(string[] args)
{
KTEST<Request> kTESTRequest = new KTEST<Request>();
kTESTRequest.PageNumber = 1;
kTESTRequest.PageSize = 20;
kTESTRequest.Filter.CountryId = 1;
}
}
}
Now, how can I get the countryId property without use of 'Filter'. I need to use kTESTRequest.CountryId instead of kTESTRequest.Filter.CountryId
Could you please help me to out this.