25 lines
546 B
Plaintext
25 lines
546 B
Plaintext
![]() |
include::../why-dotnet.adoc[]
|
||
|
|
||
|
=== Code examples
|
||
|
|
||
|
==== Noncompliant code example
|
||
|
|
||
|
[source,csharp,diff-id=1,diff-type=noncompliant]
|
||
|
----
|
||
|
public void Checkout(ILogger logger, User user, Order order)
|
||
|
{
|
||
|
logger.LogDebug("User {Id} purchased order {Id}", user.Id, order.Id);
|
||
|
}
|
||
|
----
|
||
|
|
||
|
==== Compliant solution
|
||
|
|
||
|
[source,csharp,diff-id=1,diff-type=compliant]
|
||
|
----
|
||
|
public void Checkout(ILogger logger, User user, Order order)
|
||
|
{
|
||
|
logger.LogDebug("User {UserId} purchased order {OrderId}", user.Id, order.Id);
|
||
|
}
|
||
|
----
|
||
|
|
||
|
include::../resources-dotnet.adoc[]
|