Forum Discussion

Marc Roussel's avatar
Marc Roussel
Iron Contributor
Oct 07, 2022
Solved

Boolean property true by default !?

I created a class with a Boolean.  When I instantiate it, my Boolean is true.  I don't understand.  I thought the default for Boolean was false !  Any ideas ?

Right now, I'm forced to use this attribute :

 

[DefaultValue(false)]
public bool IsDelete { get; set; }



  • Hi Marc Roussel,

    Thanks for posting your issue here.

    However this platform is used for how-to discussions and sharing best practices for building any app with .NET. Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
    Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
    Best Regards,
    Lan Huang

2 Replies

  • LanHuang's avatar
    LanHuang
    Iron Contributor

    Hi Marc Roussel,

    Thanks for posting your issue here.

    However this platform is used for how-to discussions and sharing best practices for building any app with .NET. Since your issue is a technical question, welcome to post it in Microsoft Q&A forum, the support team and communities on Microsoft Q&A will help you for any technical questions.
    Besides, it will be appreciated if you can share it here once you post this technical question Microsoft Q&A.
    Best Regards,
    Lan Huang

    • Marc Roussel's avatar
      Marc Roussel
      Iron Contributor
      Thanx
      https://learn.microsoft.com/en-us/answers/questions/1042056/boolean-is-tru-by-default.html

Resources