Dagen slutt

This commit is contained in:
Geir Okkenhaug Jerstad 2025-01-06 14:49:31 +01:00
parent 8dfac53540
commit 6361e14b88
6 changed files with 37 additions and 2 deletions

View file

@ -1,4 +1,4 @@
namespace DependencyInversionPrinciple;
namespace DIP.ChatServer;
public class ChatServer
{

View file

@ -0,0 +1,9 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -0,0 +1,10 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<OutputType>Exe</OutputType>
<TargetFramework>net8.0</TargetFramework>
<ImplicitUsings>enable</ImplicitUsings>
<Nullable>enable</Nullable>
</PropertyGroup>
</Project>

View file

@ -2,6 +2,8 @@
Microsoft Visual Studio Solution File, Format Version 12.00
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DependencyInversionPrinciple", "DependencyInversionPrinciple\DependencyInversionPrinciple.csproj", "{D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DIP.ChatServer", "DIP.ChatServer\DIP.ChatServer.csproj", "{DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
@ -12,5 +14,9 @@ Global
{D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}.Debug|Any CPU.Build.0 = Debug|Any CPU
{D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}.Release|Any CPU.ActiveCfg = Release|Any CPU
{D42BF79A-EB9A-4B1E-A7A8-E0C83D3CD844}.Release|Any CPU.Build.0 = Release|Any CPU
{DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DA3954AF-D3E2-4B05-B579-AFCF6540F1EF}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
EndGlobal

View file

@ -7,4 +7,8 @@
<Nullable>enable</Nullable>
</PropertyGroup>
<ItemGroup>
<ProjectReference Include="..\DIP.ChatServer\DIP.ChatServer.csproj" />
</ItemGroup>
</Project>

View file

@ -1,7 +1,13 @@
using DependencyInversionPrinciple;
using DIP.ChatServer;
var server = new ChatServer();
var client1 = new ChatClient("Per", server);
var client2 = new ChatClient("Knut", server);
var client3 = new ChatClient("Espen", server);
client1.Say("Hello");
client2.Say("Hello");
client3.Say("Hello");
client1.Say("Hello");