Reinforced.Typings 无法处理属性的属性
Reinforced.Typings cannot handle attributes on properties
我有一个使用 ASP.NET Identity 的 ASP.NET 核心项目。某些 class 无法导出,因为它们的属性包含来自 System.ComponentModel.DataAnnotations
的属性。如果我忽略这些属性,一切正常。
示例class:
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.
。
升级到 1.4.2 以解决此问题。
我有一个使用 ASP.NET Identity 的 ASP.NET 核心项目。某些 class 无法导出,因为它们的属性包含来自 System.ComponentModel.DataAnnotations
的属性。如果我忽略这些属性,一切正常。
示例class:
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.
。
升级到 1.4.2 以解决此问题。