SQLite.Net-PCL

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

Hello.

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,
Mike

Best Answer

Answers

  • MichaelLopez.8911MichaelLopez.8911 USUniversity ✭✭

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

Sign In or Register to comment.