Skip to content

C# Interfaces

Trevor Fayas edited this page Aug 4, 2021 · 2 revisions

As with any good design, all of the operations in the GenericEcommerce system are done through dependency injection, with Interfaces you yourself can implement and overwrite.

Since all source code is available as well, you can very easily copy one of the implementations and adjust as needed. To use your own implementation, after you initialize the services (defaults), just implement your own:

public  class Startup
{
	public  void ConfigureServices(IServiceCollection services)
	{
		...
		services.RegisterEcommerceServices(new EcommerceServiceConfiguration() { CheckoutUrl = "/Products/Checkout", ThankYouUrl = "/Products/Thank-You", UseCustomProductFields = true });

		// Implement your own
		services.AddScoped<ICartRepository, MyCustomCartRepository>();
		...
	}

}

Available Interfaces

Available to you are: