diff --git a/Volo.Abp.sln b/Volo.Abp.sln index ba6b08fe0b..a7eb296773 100644 --- a/Volo.Abp.sln +++ b/Volo.Abp.sln @@ -139,6 +139,7 @@ EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Volo.Abp.Identity.Domain.Shared", "src\Volo.Abp.Identity.Domain.Shared\Volo.Abp.Identity.Domain.Shared.csproj", "{DF676F73-3FC9-46CE-909A-2D75E19982AD}" EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Volo.Abp.EntityFrameworkCore.Tests", "test\Volo.Abp.EntityFrameworkCore.Tests\Volo.Abp.EntityFrameworkCore.Tests.csproj", "{3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SimpleConsoleDemo", "test\SimpleConsoleDemo\SimpleConsoleDemo.csproj", "{2B48CF90-DBDB-469F-941C-5B5AECEEACE0}" EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -354,6 +355,10 @@ Global {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}.Debug|Any CPU.Build.0 = Debug|Any CPU {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}.Release|Any CPU.ActiveCfg = Release|Any CPU {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8}.Release|Any CPU.Build.0 = Release|Any CPU + {2B48CF90-DBDB-469F-941C-5B5AECEEACE0}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {2B48CF90-DBDB-469F-941C-5B5AECEEACE0}.Debug|Any CPU.Build.0 = Debug|Any CPU + {2B48CF90-DBDB-469F-941C-5B5AECEEACE0}.Release|Any CPU.ActiveCfg = Release|Any CPU + {2B48CF90-DBDB-469F-941C-5B5AECEEACE0}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -420,6 +425,7 @@ Global {43D4005C-4F04-4128-937B-52BEAC5A113B} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} {DF676F73-3FC9-46CE-909A-2D75E19982AD} = {1895A5C9-50D4-4568-9A3A-14657E615A5E} {3AF7C7F5-6513-47D4-8DD0-6E1AF14568D8} = {37087D1B-3693-4E96-983D-A69F210BDE53} + {2B48CF90-DBDB-469F-941C-5B5AECEEACE0} = {37087D1B-3693-4E96-983D-A69F210BDE53} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {BB97ECF4-9A84-433F-A80B-2A3285BDD1D5} diff --git a/test/SimpleConsoleDemo/Program.cs b/test/SimpleConsoleDemo/Program.cs new file mode 100644 index 0000000000..8193538354 --- /dev/null +++ b/test/SimpleConsoleDemo/Program.cs @@ -0,0 +1,68 @@ +using System; +using Microsoft.Extensions.DependencyInjection; +using Volo.Abp; +using Volo.Abp.DependencyInjection; +using Volo.Abp.Modularity; + +namespace SimpleConsoleDemo +{ + class Program + { + static void Main(string[] args) + { + using (var application = AbpApplicationFactory.Create(options => + { + + })) + { + application.Initialize(); + + Console.WriteLine("ABP initialized... Press ENTER to exit!"); + + var writers = application.ServiceProvider.GetServices(); + foreach (var writer in writers) + { + writer.Write(); + } + + Console.ReadLine(); + } + } + } + + public class MyConsoleModule : AbpModule + { + public override void ConfigureServices(IServiceCollection services) + { + services.AddAssemblyOf(); + } + } + + public interface IMessageWriter + { + void Write(); + } + + public class ConsoleMessageWriter : IMessageWriter, ITransientDependency + { + private readonly MessageSource _messageSource; + + public ConsoleMessageWriter(MessageSource messageSource) + { + _messageSource = messageSource; + } + + public void Write() + { + Console.WriteLine(_messageSource.GetMessage()); + } + } + + public class MessageSource : ITransientDependency + { + public string GetMessage() + { + return "Hello ABP!"; + } + } +} \ No newline at end of file diff --git a/test/SimpleConsoleDemo/SimpleConsoleDemo.csproj b/test/SimpleConsoleDemo/SimpleConsoleDemo.csproj new file mode 100644 index 0000000000..d2cd131578 --- /dev/null +++ b/test/SimpleConsoleDemo/SimpleConsoleDemo.csproj @@ -0,0 +1,12 @@ + + + + Exe + netcoreapp2.0 + + + + + + +