Localize using strongly typed resources:

generated Class with

     strotygen -p -t Yavsc.Models.IT.Fixing.Bug.resx

must be modified :

* prefix with 'Yavsc.Server.Resources.'  the baseName
  in call to new System.Resources.ResourceManager
* remove the internal ctor

additionally, the generated class must be or unique or partial
This commit is contained in:
Paul Schneider 2019-06-16 13:10:14 +01:00
commit 9501ee1f16
13 changed files with 342 additions and 44 deletions

View file

@ -1,4 +1,4 @@
using System;
using System;
using Microsoft.AspNet.Builder;
using Microsoft.AspNet.Builder.Internal;
using Microsoft.AspNet.Razor;
@ -29,13 +29,13 @@ namespace test
[Collection("Yavsc mandatory success story")]
[Trait("regres", "no")]
public class YavscMandatory: BaseTestContext, IClassFixture<ServerSideFixture>, IDisposable
public class BatchTests: BaseTestContext, IClassFixture<ServerSideFixture>, IDisposable
{
ApplicationDbContext _dbContext;
ServerSideFixture _fixture;
public YavscMandatory(ITestOutputHelper output, ServerSideFixture fixture) : base (output, fixture)
public BatchTests(ITestOutputHelper output, ServerSideFixture fixture) : base (output, fixture)
{
_dbContext = fixture.DbContext;
_fixture = fixture;

View file

@ -0,0 +1,23 @@
namespace test {
public class ResxResources {
const string resPath = "Resources/Test.TestResources.resx";
public void HaveAResxLoader()
{
System.Resources.ResourceReader loader = new System.Resources.ResourceReader(resPath);
// IDictionary
var etor = loader.GetEnumerator();
while (etor.Current !=null)
{
byte[] data;
string stringdata;
string resName = etor.Key.ToString();
loader.GetResourceData(resName, out stringdata, out data);
}
}
}
}