flowchart TD
subgraph FEATURES
Presentation --> Application
Application --> Domain
Domain --> Infrastructure
Infrastructure --> Database
end
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Target Name="CopyDLLs" AfterTargets="Build"> | |
<Message Text="Executing Copy Command Task" Importance="High" /> | |
<PropertyGroup> | |
<PublishedCommandsDir>..\..\..\..\Calabonga.Commandex.Shell\PublishedCommands</PublishedCommandsDir> | |
</PropertyGroup> | |
<Copy SourceFiles="$(TargetDir)$(ProjectName).dll;$(TargetDir)$(ProjectName).pdb" DestinationFolder="$(PublishedCommandsDir)" /> | |
<Message Text="Command $(ProjectName) successfully copied" Importance="High" /> | |
</Target> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public struct Money | |
{ | |
private readonly double _amount; | |
public Money(double amount) | |
{ | |
_amount = amount; | |
} | |
public double Amount => _amount; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[RankColumn] | |
[HideColumns(new string[] { "Job" })] | |
[MemoryDiagnoser(false)] | |
[SimpleJob(RuntimeMoniker.Net60)] | |
[SimpleJob(RuntimeMoniker.Net70)] | |
[GroupBenchmarksBy(BenchmarkLogicalGroupRule.ByMethod)] | |
public class Benchmark | |
{ | |
// ... start from here | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var options = new JsonSerializerOptions | |
{ | |
DefaultIgnoreCondition = JsonIgnoreCondition.WhenWritingNull, | |
Encoder = JavaScriptEncoder.UnsafeRelaxedJsonEscaping, | |
ReferenceHandler = ReferenceHandler.IgnoreCycles, | |
WriteIndented = true | |
} | |
var json = JsonSerializer.Serialize(state, options); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace Samples; | |
public class AppSettings | |
{ | |
public string? Name { get; set; } | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Project> | |
<PropertyGroup> | |
<!-- <LangVersion>latest</LangVersion> --> | |
<!--<LangVersion>preview</LangVersion>--> | |
<LangVersion>8</LangVersion> | |
</PropertyGroup> | |
</Project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"$schema": "https://xunit.net/schema/current/xunit.runner.schema.json", | |
"methodDisplay": "method", | |
"methodDisplayOptions": "all" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class TaskHelper | |
{ | |
/// <summary> | |
/// Runs a TPL Task fire-and-forget style, the right way - in the | |
/// background, separate from the current thread, with no risk | |
/// of it trying to rejoin the current thread. | |
/// </summary> | |
public static void RunBg(Func<Task> fn) => Task.Run(fn).ConfigureAwait(false); | |
/// <summary> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public static class AsyncHelpers | |
{ | |
/// <summary> | |
/// Executes an async Task<T> method which has a void return value synchronously | |
/// </summary> | |
/// <param name="task">Task<T> method to execute</param> | |
public static void RunSync(Func<Task> task) | |
{ | |
var oldContext = SynchronizationContext.Current; | |
var synch = new ExclusiveSynchronizationContext(); |
NewerOlder