July 2019
Intermediate to advanced
410 pages
10h 32m
English
With CatalogService defined, the team is finally able to put everything together in .NET Core. The start of all applications, that is, EXE programs, is the Main method, and .NET Core is no exception. The program is shown in the following code:
class Program{ private static void Main(string[] args) { IServiceCollection services = new ServiceCollection(); ConfigureServices(services); IServiceProvider serviceProvider = services.BuildServiceProvider(); var service = serviceProvider.GetService<ICatalogService>(); service.Run(); Console.WriteLine("CatalogService has completed."); } private static void ConfigureServices(IServiceCollection services) { // Add application services. services.AddTransient<IUserInterface, ConsoleUserInterface>(); ...Read now
Unlock full access