Reinforced.Typings无法处理属性的属性

问题描述 投票:2回答:1

我有一个使用ASP.NET Identity的ASP.NET Core项目。某些类无法导出,因为它们的属性包含System.ComponentModel.DataAnnotations的属性。如果我忽略这些属性,一切正常。

示例类:

public class LoginViewModel
{
    [Required]
    [EmailAddress]
    public string Email { get; set; }

    [Required]
    [DataType(DataType.Password)]
    public string Password { get; set; }

    [Display(Name = "Remember me?")]
    public bool RememberMe { get; set; }
}

由于我不想删除这些属性,建议的行动方案是什么?

[assembly: TsGlobal(
    CamelCaseForMethods = true,
    CamelCaseForProperties = true,
    GenerateDocumentation = true,
    UseModules = true,
    DiscardNamespacesWhenUsingModules = true)]

namespace X
{
    public static class ReinforcedTypingsConfiguration
    {
        public static void Configure(ConfigurationBuilder builder)
        {
            builder
                .ExportAsInterface<LoginViewModel>()
                .AutoI(false)
                .WithProperty(x => x.RememberMe)
                ;
        }
    }
}

除此之外,似乎UseModules与我希望它做的相反。设置为true时,生成的ts文件不包含任何模块。当设置为false时,我在我的ts文件中获得module

此外,当在文件之间划分类型时,我在mac上获得奇怪的文件夹名称,包含\,用于我的命名空间中的每个.。我可以把结构弄平吗?并完全忽略后端命名空间?

在上面的配置(我使用文件分割)我得到恼人的错误消息error MSB3552: Resource file "**/*.resx" cannot be found.

c# asp.net-core reinforced-typings
1个回答
1
投票

升级到1.4.2以解决此问题。

© www.soinside.com 2019 - 2024. All rights reserved.