Skip to content

Commit a9c5045

Browse files
authored
Merge pull request #62 from Mehdi-Aghaei/dev/adjust-markdown
Add Markdown Syntax Highlighting for C#
2 parents dc4a60b + f9c303b commit a9c5045

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

README.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,15 +26,15 @@ To enable this library to automatically resolve and invoke validators for your m
2626

2727
Manually register your validator with the service container:
2828

29-
```
29+
```cs
3030
services.AddScoped<IValidator<User>, UserValidator>();
3131
```
3232

3333
#### Automatic registration
3434

3535
Automatically register all validators from the assembly containing your UserValidator:
3636

37-
```
37+
```cs
3838
services.AddValidatorsFromAssemblyContaining<UserValidator>();
3939
```
4040

@@ -44,7 +44,7 @@ For more instructions on setting that up please see https://docs.fluentvalidatio
4444

4545
For MVC controllers reference NuGet package `SharpGrip.FluentValidation.AutoValidation.Mvc` (https://www.nuget.org/packages/SharpGrip.FluentValidation.AutoValidation.Mvc).
4646

47-
```
47+
```cs
4848
using SharpGrip.FluentValidation.AutoValidation.Mvc.Extensions;
4949

5050
builder.Services.AddFluentValidationAutoValidation();
@@ -56,7 +56,7 @@ For minimal APIs (endpoints) reference NuGet package `SharpGrip.FluentValidation
5656

5757
Enabling minimal API (endpoint) automatic validation can be done on both route groups and routes.
5858

59-
```
59+
```cs
6060
using SharpGrip.FluentValidation.AutoValidation.Endpoints.Extensions;
6161

6262
builder.Services.AddFluentValidationAutoValidation();
@@ -83,7 +83,7 @@ app.MapPost("/", (SomeOtherModel someOtherModel) => $"Hello again {someOtherMode
8383
| EnableCustomBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters bound from `BindingSource.Custom` binding sources. |
8484
| EnableNullBindingSourceAutomaticValidation | `false` | Enables asynchronous automatic validation for parameters not bound from any binding source (typically parameters without a declared or inferred binding source). |
8585

86-
```
86+
```cs
8787
using SharpGrip.FluentValidation.AutoValidation.Mvc.Extensions;
8888

8989
builder.Services.AddFluentValidationAutoValidation(configuration =>
@@ -124,7 +124,7 @@ public class CustomResultFactory : IFluentValidationAutoValidationResultFactory
124124

125125
### Minimal APIs (endpoints)
126126

127-
```
127+
```cs
128128
using SharpGrip.FluentValidation.AutoValidation.Endpoints.Extensions;
129129

130130
builder.Services.AddFluentValidationAutoValidation(configuration =>
@@ -189,7 +189,7 @@ In case you return `null` the default `IValidationResult` will be passed to the
189189

190190
### MVC controllers
191191

192-
```
192+
```cs
193193
// Example of a global validation interceptor.
194194
builder.Services.AddTransient<IGlobalValidationInterceptor, CustomGlobalValidationInterceptor>();
195195

@@ -234,7 +234,7 @@ private class TestValidator : AbstractValidator<TestModel>, IValidatorIntercepto
234234

235235
### Minimal APIs (endpoints)
236236

237-
```
237+
```cs
238238
// Example of a global validation interceptor.
239239
builder.Services.AddTransient<IGlobalValidationInterceptor, CustomGlobalValidationInterceptor>();
240240

0 commit comments

Comments
 (0)