fix(client-controller): single constructor with IHtmlLocalizer
The partial class ClientController had two constructors declared across ClientController.cs and ClientController.Collections.cs. ASP.NET Core DI failed to pick one at request time with: System.InvalidOperationException: Multiple constructors accepting all given argument types have been found in type 'Yavsc.Controllers.ClientController'. Move IHtmlLocalizer<ClientController> into the primary constructor in ClientController.cs and drop the duplicate one in ClientController.Collections.cs. The Collections partial now keeps only its readonly field and action methods; the constructor and field assignment are unified on the main file. Also add the missing 'using Microsoft.AspNetCore.Mvc.Localization;' to ClientController.cs so IHtmlLocalizer resolves.
This commit is contained in:
parent
ecac359344
commit
6aaff74082
13 changed files with 582 additions and 23 deletions
42
src/Yavsc.Org.Tests/test.runsettings
Normal file
42
src/Yavsc.Org.Tests/test.runsettings
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
<RunSettings>
|
||||
<RunConfiguration>
|
||||
</RunConfiguration>
|
||||
<LoggerRunSettings>
|
||||
<Loggers>
|
||||
<Logger friendlyName="blame" enabled="True" />
|
||||
|
||||
<Logger friendlyName="console" enabled="True">
|
||||
<Configuration>
|
||||
<Verbosity>quiet</Verbosity>
|
||||
</Configuration>
|
||||
</Logger>
|
||||
<Logger friendlyName="trx" enabled="True">
|
||||
<Configuration>
|
||||
<LogFileName>Yavsc.Org.tests.trx</LogFileName>
|
||||
</Configuration>
|
||||
</Logger>
|
||||
<Logger friendlyName="html" enabled="True">
|
||||
<Configuration>
|
||||
<LogFileName>Yavsc.Org.tests.html</LogFileName>
|
||||
</Configuration>
|
||||
</Logger>
|
||||
</Loggers>
|
||||
</LoggerRunSettings>
|
||||
|
||||
<DataCollectionRunSettings>
|
||||
<DataCollectors>
|
||||
<!-- Enables blame -->
|
||||
<DataCollector friendlyName="blame" enabled="True">
|
||||
<Configuration>
|
||||
<!-- Enables crash dump, with dump type "Full" or "Mini".
|
||||
Requires ProcDump in PATH for .NET Framework. -->
|
||||
<CollectDump DumpType="Full" />
|
||||
<!-- Enables hang dump or testhost and its child processes
|
||||
when a test hangs for more than 10 minutes.
|
||||
Dump type "Full", "Mini" or "None" (just kill the processes). -->
|
||||
<CollectDumpOnTestSessionHang TestTimeout="10min" HangDumpType="Full" />
|
||||
</Configuration>
|
||||
</DataCollector>
|
||||
</DataCollectors>
|
||||
</DataCollectionRunSettings>
|
||||
</RunSettings>
|
||||
Loading…
Add table
Add a link
Reference in a new issue