Is it OK to call virtual properties from the constructor of a NHibernate entity?

前端 未结 6 604
有刺的猬
有刺的猬 2020-12-11 01:02

take a look at this example code:

public class Comment
{
    private Comment()
    { }

    public Comment(string text, DateTime creationDate, string authorE         


        
6条回答
  •  遥遥无期
    2020-12-11 01:12

    I'm pretty sure this is fine, but if your worried you could always just assign the properties after a parameter less constructor call.

提交回复
热议问题