1

I have created bool field in Database model

Here is it public virtual bool IsActive { get; set; }

I need to set default value 'false' to column

So every new entry will have false value in this column

How I can make this via codefirst in migrations?

Eugene Sukh
  • 2,357
  • 4
  • 42
  • 86

1 Answers1

0

You can try to take advantage of using auto-property initialization:

public virtual bool IsActive {get; set} = false;

For more info suggest you to check this discussion: https://stackoverflow.com/a/40937124/9709828

yemo
  • 145
  • 8