using System; using Microsoft.Extensions.DependencyInjection; using Volo.Abp; using Volo.Abp.Threading; namespace Acme.BookStore.ConsoleApiClient { /* Before running this application, ensure that the Acme.BookStore.Web application is running. */ class Program { static void Main(string[] args) { using (var application = AbpApplicationFactory.Create(options => { options.UseAutofac(); })) { application.Initialize(); using (var scope = application.ServiceProvider.CreateScope()) { var demoService = scope.ServiceProvider.GetRequiredService(); AsyncHelper.RunSync(() => demoService.RunAsync()); } Console.WriteLine("Press ENTER to stop application..."); Console.ReadLine(); } } } }