Using Servicestack ORMLite in Class library

63 views Asked by At

Is it possible to use Servicestack ORMLite in a C# Class library?

I have been searching the internet but cant find any example where the data layer is used in a class library

1

There are 1 answers

0
mythz On

Sure, there's nothing special about a class library, you'll just need to pass in an open ADO.NET IDbConnection or an IDbConnectionFactory and you can use OrmLites extension methods as normal. A class library would also only need a reference to the ServiceStack.OrmLite NuGet package, I.e. Doesn't require a reference to any concrete RDBMS provider.