关于rowversion列,Entity Framework是否有某种约定优先于配置?因此,我不需要在时间戳属性上添加任何属性
public class ProductId
{
// [Key] // This is optional, EF automatically picks up
// ProductId as primary key
public int ProductId { get; set; }
public int ProductName { get; set; }
// I want to remove Timestamp attribute,
// Fluent NHibernate CoC automatically picks up property with name of
// Version as the rowversion property
[Timestamp]
public byte[] Version { get; set; }
}发布于 2011-08-05 16:00:44
是的,有,但是你不会喜欢的。所有数据注释属性都是按照约定处理的,所以您的示例就是使用它的那个。对于行版本,没有其他约定。
https://stackoverflow.com/questions/6950085
复制相似问题