SqlRepo and related components are currently available via NuGet and include the following packages ### SqlRepo This package contains the core components and will usually be installed as a dependency when other packages are installed. However if you are looking to extend SqlRepo or contribute an alternative implementation you can install the package like this: ```bash Install-Package SqlRepo ``` or ```bash dotnet-install-package SqlRepo ``` ### SqlRepo.SqlServer This package contains the core components of a Microsoft SQL Server implementation of SqlRepo it may be installed as a dependency of packages below but you can install the package directly like this: ```bash Install-Package SqlRepo.SqlServer ``` or ```bash dotnet-install-package SqlRepo.SqlServer ``` ### SqlRepo.SqlServer.Autofac This package contains an Autofac module that simplifies the registration of SqlRepo and SqlRepo.SqlServer components for Dependency Injection when using Autofac. You can install the package like this: ```bash Install-Package SqlRepo.SqlServer.Autofac ``` or ```bash dotnet-install-package SqlRepo.SqlServer.Autofac ``` Once the package is installed you will need to register the module with Autofac using something like this: ```bash var containerBuilder = new ContainerBuilder(); containerBuilder.RegisterModule(); // other registrations... var container = containerBuilder.Build(); ``` ### SqlRepo.SqlServer.NInject This package contains a NInject module that simplifies the registration of SqlRepo and SqlRepo.SqlServer components for Dependency Injection when using NInject. You can install the package like this: ```bash Install-Package SqlRepo.SqlServer.NInject ``` or ```bash dotnet-install-package SqlRepo.SqlServer.NInject ``` Once the package is installed you will need to add the module to the NInject Kernel using something like this: ```bash IKernel kernel = new StandardKernel(new SqlRepoSqlServerNInjectModule(), ...); ``` ### SqlRepo.SqlServer.ServiceCollection This package contains an extension method that simplifies the registration of SqlRepo and SqlRepo.SqlServer components for Dependency Injection when using the default IoC container with .NET Core. You can install the package like this: ```bash Install-Package SqlRepo.SqlServer.ServiceCollection ``` or ```bash dotnet-install-package SqlRepo.SqlServer.ServiceCollection ``` Once the package is installed you will need to call the extension method to register SqlRepo and SqlRepo.SqlServer components as services using something like this: ```bash var services = new ServiceCollection() .AddSqlRepo(); var serviceProvider = services.BuildServiceProvider(); var repositoryFactory = serviceProvider.GetService(); ``` This [gist](https://gist.github.com/MarkioE/599566fed0237fc50a6b57db876a03c4) provides an example of how you might use the extension method in ASP.NET Core. ### SqlRepo.SqlServer.Static This package contains a static wrapper for our IRepositoryFactory for those who can't or don't want to use Dependency Injection. This might also prove useful if you want to quickly review SqlRepo.SqlServer without having to take the trouble to setup a DI container. You can install the package like this. ```bash Install-Package SqlRepo.SqlServer.Static ``` or ```bash dotnet-install-package SqlRepo.SqlServer.Static ``` Then you can use it to get a repository like this: ```bash RepoFactory.Create(); ``` ### SqlRepo.Testing.NSubstitute This package contains extension methods that make testing SqlRepo easier when using NSubstitute for mocking. The extension methods allow you to make assertions that components were called as expected without having to write message code using expressions. This code is encapsulated for you. ```bash Install-Package SqlRepo.Testing.NSubstitute ``` or ```bash dotnet-install-package SqlRepo.Testing.NSubstitute ``` Now in your tests you can make assertions like these: ```csharp selectStatement.ReceivedWhereEquals("Name", expectedName); selectStatement.ReceivedAndIn("Status", new []{"Active", "Pending"}); ```