PI06 i PI06-1. Docker definitions for MSSQL and Postgres. Data seeder/generator for countries and people. Entity Framework example with variants for Postgres and MSSQL
This commit is contained in:
14
DefensiveProgramming/Conditional/Conditional.csproj
Normal file
14
DefensiveProgramming/Conditional/Conditional.csproj
Normal file
@@ -0,0 +1,14 @@
|
||||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<OutputType>Exe</OutputType>
|
||||
<TargetFramework>net10.0</TargetFramework>
|
||||
<ImplicitUsings>enable</ImplicitUsings>
|
||||
<Nullable>enable</Nullable>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>TRACE;DEMO</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
</Project>
|
||||
20
DefensiveProgramming/Conditional/Program.cs
Normal file
20
DefensiveProgramming/Conditional/Program.cs
Normal file
@@ -0,0 +1,20 @@
|
||||
#define DEMO2
|
||||
|
||||
using System.Diagnostics;
|
||||
|
||||
Console.WriteLine("Start");
|
||||
|
||||
#if DEMO
|
||||
Console.WriteLine("Print something...");
|
||||
#endif
|
||||
|
||||
CheckSomething();
|
||||
|
||||
Console.WriteLine("End");
|
||||
|
||||
[Conditional("DEMO")]
|
||||
static void CheckSomething()
|
||||
{
|
||||
Console.WriteLine("Print from CheckSomething method");
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user