Added console tester

messaging
Tudor Stanciu 2019-10-29 00:11:42 +02:00
parent 08b12621b4
commit 5914d6bd1c
3 changed files with 52 additions and 1 deletions

View File

@ -0,0 +1,12 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>netcoreapp3.0</TargetFramework>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\NDB.Infrastructure.PublicIP\NDB.Infrastructure.PublicIP.csproj" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,33 @@
using Microsoft.Extensions.DependencyInjection;
using NDB.Infrastructure.PublicIP;
using NDB.Infrastructure.PublicIP.Services;
using System;
using System.Threading.Tasks;
namespace NDB.Testing.App
{
class Program
{
static async Task Main(string[] args)
{
Console.WriteLine("Hello World!");
var provider = GetServiceProvider();
var service = provider.GetService<IPublicIPService>();
var result = await service.GetPublicIP();
Console.WriteLine(result.ip);
Console.ReadKey();
}
private static IServiceProvider GetServiceProvider()
{
var services = new ServiceCollection();
services.AddPublicIPService();
var provider = services.BuildServiceProvider();
return provider;
}
}
}

View File

@ -13,7 +13,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution
Notes.txt = Notes.txt Notes.txt = Notes.txt
EndProjectSection EndProjectSection
EndProject EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NDB.Infrastructure.PublicIP", "NDB.Infrastructure.PublicIP\NDB.Infrastructure.PublicIP.csproj", "{FCB29735-E36A-442A-9307-F124782B8BB8}" Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NDB.Infrastructure.PublicIP", "NDB.Infrastructure.PublicIP\NDB.Infrastructure.PublicIP.csproj", "{FCB29735-E36A-442A-9307-F124782B8BB8}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NDB.Testing.App", "NDB.Testing.App\NDB.Testing.App.csproj", "{656CCE38-90C3-4D19-9D07-EF1F0410CFDC}"
EndProject EndProject
Global Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution GlobalSection(SolutionConfigurationPlatforms) = preSolution
@ -29,6 +31,10 @@ Global
{FCB29735-E36A-442A-9307-F124782B8BB8}.Debug|Any CPU.Build.0 = Debug|Any CPU {FCB29735-E36A-442A-9307-F124782B8BB8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FCB29735-E36A-442A-9307-F124782B8BB8}.Release|Any CPU.ActiveCfg = Release|Any CPU {FCB29735-E36A-442A-9307-F124782B8BB8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FCB29735-E36A-442A-9307-F124782B8BB8}.Release|Any CPU.Build.0 = Release|Any CPU {FCB29735-E36A-442A-9307-F124782B8BB8}.Release|Any CPU.Build.0 = Release|Any CPU
{656CCE38-90C3-4D19-9D07-EF1F0410CFDC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{656CCE38-90C3-4D19-9D07-EF1F0410CFDC}.Debug|Any CPU.Build.0 = Debug|Any CPU
{656CCE38-90C3-4D19-9D07-EF1F0410CFDC}.Release|Any CPU.ActiveCfg = Release|Any CPU
{656CCE38-90C3-4D19-9D07-EF1F0410CFDC}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection EndGlobalSection
GlobalSection(SolutionProperties) = preSolution GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE HideSolutionNode = FALSE