SOLVED

Boolean property true by default !?

Iron Contributor

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; }



2 Replies
best response confirmed by Marc Roussel (Iron Contributor)
Solution

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

1 best response

Accepted Solutions
best response confirmed by Marc Roussel (Iron Contributor)
Solution

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

View solution in original post