MichaelLopez.8911MichaelLopez.8911 USUniversity ✭✭
edited November 2014 in Cross Platform with Xamarin


I'm creating a PCL Xamarin.Forms project and am using SQLite.Net-PCL. My model has an abstract base type, ProductBase with a protected constructor, and two subtypes, ProductA and ProductB, both of which has a parameterless public constructor.

I would like to implement a database method public List<BaseProduct> GetProducts() which would return both ProductA and ProductB types, but obviously this won't work because ProductBase doesn't expose a parameterless constructor, and I'm not sure that SQLite would perform the implicit conversions.

What is the recommended way for implementing something like this?

Thanks in advance,

Best Answer


  • MichaelLopez.8911MichaelLopez.8911 USUniversity ✭✭

    Thanks, Guillermo. That's what I wound up doing.

Sign In or Register to comment.