Using Servicestack ORMLite in Class library

107 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 best solutions below

0
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.