You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The premise of this library is that it can extend the built-in enum types in .NET, but still, it will mimic the behavior of the enum types. SmartEnums even though defined as classes, they're extended to offer value-type behavior.
This PR enables creating a SmartEnum with a null value. This breaks the assumed contract and leads to various inconsistencies. For instance, we can no longer guarantee that SmartEnum can be used as dictionary keys.
vartypes=newDictionary<CustomerType,object>();
types.Add(CustomerType.One,new());// Will throwpublicclassCustomerType:SmartEnum<CustomerType,string>{publicstaticCustomerTypeOne=new CustomerType("One",null);publicstaticCustomerTypeTwo=new CustomerType("Two","two");protectedCustomerType(stringname,stringvalue):base(name, value){}}
The text was updated successfully, but these errors were encountered:
The premise of this library is that it can extend the built-in enum types in .NET, but still, it will mimic the behavior of the enum types. SmartEnums even though defined as classes, they're extended to offer value-type behavior.
This PR enables creating a SmartEnum with a null value. This breaks the assumed contract and leads to various inconsistencies. For instance, we can no longer guarantee that SmartEnum can be used as dictionary keys.
The text was updated successfully, but these errors were encountered: