Skip to content

Commit 05c6efb

Browse files
CopilotAndriySvyryd
andcommitted
Remove customizing individual services section per review feedback
Co-authored-by: AndriySvyryd <[email protected]>
1 parent e26cd9a commit 05c6efb

File tree

1 file changed

+0
-22
lines changed

1 file changed

+0
-22
lines changed

entity-framework/core/cli/services.md

Lines changed: 0 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -11,28 +11,6 @@ Some services used by the tools are only used at design time. These services are
1111

1212
[!code-csharp[Main](../../../samples/core/Miscellaneous/CommandLine/DesignTimeServices.cs#DesignTimeServices)]
1313

14-
### Customizing individual services
15-
16-
You can also override individual methods in design-time services. For example, to customize how type names are generated in scaffolded code to always use fully-qualified names (which can help avoid compilation errors due to ambiguous type references), you can override the `ShouldUseFullName` method in `CSharpHelper`:
17-
18-
```csharp
19-
public class MyDesignTimeServices : IDesignTimeServices
20-
{
21-
public void ConfigureDesignTimeServices(IServiceCollection services)
22-
=> services.AddSingleton<ICSharpHelper, MyCSharpHelper>();
23-
}
24-
25-
public class MyCSharpHelper : CSharpHelper
26-
{
27-
public MyCSharpHelper(ITypeMappingSource typeMappingSource) : base(typeMappingSource)
28-
{
29-
}
30-
31-
public override bool ShouldUseFullName(Type type)
32-
=> true; // Always use fully-qualified type names
33-
}
34-
```
35-
3614
## Referencing Microsoft.EntityFrameworkCore.Design
3715

3816
Microsoft.EntityFrameworkCore.Design is a DevelopmentDependency package. This means that the dependency won't flow transitively into other projects, and that you cannot, by default, reference its types.

0 commit comments

Comments
 (0)