Closed tonysneed closed 2 years ago
Table comments are encoded. Some property comments are encoded, but others are not encoded -- but only when data annotations are used.
Here is output when templates are applied to Product
with table and property comments in Chinese.
namespace FakeNamespace
{
/// <summary>
/// 产品
/// </summary>
[Table("Product")]
[Index(nameof(CategoryId), Name = "IX_Product_CategoryId")]
public partial class Product
{
/// <summary>
/// 编号
/// </summary>
[Key]
public int ProductId { get; set; }
/// <summary>
/// 名称
/// </summary>
[Required]
[StringLength(40)]
public string ProductName { get; set; }
[Column(TypeName = "money")]
public decimal? UnitPrice { get; set; }
public bool Discontinued { get; set; }
public byte[] RowVersion { get; set; }
public int? CategoryId { get; set; }
[ForeignKey(nameof(CategoryId))]
[InverseProperty("Products")]
public virtual Category Category { get; set; }
}
}
The behavior is inconsistent. Comments on the class name are encoded even with attributes. The ProductId
property has a [Key]
attribute and the comment is not encoded. But the next property, 'ProductName' has some attributes and is encoded. If there is no #each property-annotations
in the template, then the all the property comments are encoded.
To me this looks like a bug in Handlebars.Net. I filed this issue there.
Replace with #200
Add Chinese comments to tests. Set NoEscape true in template services.
Closes #30.