56 lines
691 B
Plaintext
56 lines
691 B
Plaintext
== Why is this an issue?
|
|
|
|
include::../description.adoc[]
|
|
|
|
=== Noncompliant code example
|
|
|
|
[source,csharp]
|
|
----
|
|
class Program
|
|
{
|
|
public int Foo //Non-Compliant
|
|
{
|
|
set
|
|
{
|
|
// ... some code ...
|
|
}
|
|
}
|
|
}
|
|
----
|
|
|
|
=== Compliant solution
|
|
|
|
[source,csharp]
|
|
----
|
|
class Program
|
|
{
|
|
private int foo;
|
|
|
|
public void SetFoo(int value)
|
|
{
|
|
// ... some code ...
|
|
foo = value;
|
|
}
|
|
}
|
|
----
|
|
|
|
or
|
|
|
|
|
|
[source,csharp]
|
|
----
|
|
class Program
|
|
{
|
|
public int Foo { get; set; } // Compliant
|
|
}
|
|
----
|
|
ifdef::env-github,rspecator-view[]
|
|
|
|
'''
|
|
== Implementation Specification
|
|
(visible only on this page)
|
|
|
|
include::../message.adoc[]
|
|
|
|
endif::env-github,rspecator-view[]
|