Writing IServiceCollection
IServiceCollection
is an interface from the DependencyInjection
namespace. We are going to use IServiceCollection
for our dependency injection.
And finally, there is a dependency injection for the Travel.Application
project. Create a C# file in the root
folder of the Travel.Application
project:
// DependencyInjection.cs
… namespace Travel.Application {   public static class DependencyInjection   {     public static IServiceCollection AddApplication(this      IServiceCollection services)     {       services.AddAutoMapper         (Assembly.GetExecutingAssembly());       services.AddValidatorsFromAssembly         (Assembly.GetExecutingAssembly());       services.AddMediatR(Assembly.GetExecutingAssembly...