Skip to content

Commit 501785d

Browse files
imba-tjdBillWagner
authored andcommitted
Add a hint (#9767)
* Add a hint * Update attributes.md
1 parent 2d6ef82 commit 501785d

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

docs/csharp/tutorials/attributes.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ Attributes act as metadata. Without some outward force, they won't actually do a
121121
To find and act on attributes, [Reflection](../programming-guide/concepts/reflection.md) is generally needed. I won't cover Reflection in-depth in this tutorial, but the basic
122122
idea is that Reflection allows you to write code in C# that examines other code.
123123

124-
For instance, you can use Reflection to get information about a class:
124+
For instance, you can use Reflection to get information about a class(add `using System.Reflection;` at the head of your code):
125125

126126
[!code-csharp[Getting type information with Reflection](../../../samples/snippets/csharp/tutorials/attributes/Program.cs#ReflectionExample1)]
127127

docs/framework/wcf/feature-details/troubleshooting-correlation.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -240,4 +240,4 @@ The following example shows a <xref:System.ServiceModel.Activities.Receive> acti
240240
<p1:OutArgument x:TypeArguments="m:AddItemMessage">[AddItemMessage]</p1:OutArgument>
241241
</ReceiveMessageContent>
242242
</Receive>
243-
```
243+
```

docs/standard/microservices-architecture/multi-container-microservice-net-applications/data-driven-crud-microservice.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,7 @@ The docker-compose.yml files at the solution level are not only more flexible th
251251
252252
Finally, you can get that value from your code by using Configuration\["ConnectionString"\], as shown in the ConfigureServices method in an earlier code example.
253253
254-
However, for production environments, you might want to explore additional ways on how to store secrets like the connection strings. An excellent way to manage application secrets is using [Azure Key Vault}(https://azure.microsoft.com/services/key-vault/).
254+
However, for production environments, you might want to explore additional ways on how to store secrets like the connection strings. An excellent way to manage application secrets is using [Azure Key Vault](https://azure.microsoft.com/services/key-vault/).
255255
256256
Azure Key Vault helps to store and safeguard cryptographic keys and secrets used by your cloud applications and services. A secret is anything you want to keep strict control of, like API keys, connection strings, passwords, etc. and strict control includes usage logging, setting expiration, managing access, <span class="underline">among others</span>.
257257
@@ -427,4 +427,4 @@ It is that simple. And because it is automatically generated, the Swagger metada
427427

428428
>[!div class="step-by-step"]
429429
>[Previous](microservice-application-design.md)
430-
>[Next](multi-container-applications-docker-compose.md)
430+
>[Next](multi-container-applications-docker-compose.md)

docs/standard/modern-web-apps-azure-architecture/develop-asp-net-core-mvc-apps.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ ASP.NET Core has built-in support for and internally makes use of a technique kn
7777

7878
Static cling occurs when your classes make calls to static methods, or access static properties, which have side effects or dependencies on infrastructure. For example, if you have a method that calls a static method, which in turn writes to a database, your method is tightly coupled to the database. Anything that breaks that database call will break your method. Testing such methods is notoriously difficult, since such tests either require commercial mocking libraries to mock the static calls, or can only be tested with a test database in place. Static calls that don't have any dependence on infrastructure, especially those that are completely stateless, are fine to call and have no impact on coupling or testability (beyond coupling code to the static call itself).
7979

80-
Many developers understand the risks of static cling and global state, but will still tightly couple their code to specific implementations through direct instantiation. "New is glue" is meant to be a reminder of this coupling, and not a general condemnation of the use of the new keyword. Just as with static method calls, new instances of types that have no external dependencies typically do not tightly couple code to implementation details or make testing more difficult. But each time a class is instantiated, take just a brief moment to consider whether it makes sense to hard-code that specific instance in that particular location, or if it would be a better design to request that instance as a dependency.
80+
Many developers understand the risks of static cling and global state, but will still tightly couple their code to specific implementations through direct instantiation. "New is glue" is meant to be a reminder of this coupling, and not a general condemnation of the use of the `new` keyword. Just as with static method calls, new instances of types that have no external dependencies typically do not tightly couple code to implementation details or make testing more difficult. But each time a class is instantiated, take just a brief moment to consider whether it makes sense to hard-code that specific instance in that particular location, or if it would be a better design to request that instance as a dependency.
8181

8282
### Declare your dependencies
8383

0 commit comments

Comments
 (0)