IT Nursery
PHP 7 introduces return type declarations. Which means I can now indicate the return value is a certain class, interface, array, callable or one of the newly hintable scalar...
  • June 3, 2022
  • 0 Comments
IT Nursery
I have an enum string name; public enum Color { Red, Green, Yellow } How to set it to NULL on load. name = ""; Color color = null;...
  • May 27, 2022
  • 0 Comments
How do I check if a given object is nullable in other words how to implement the following method… bool IsNullableValueType(object o) { ... } I am looking for...
  • May 26, 2022
  • 0 Comments
There is paradox in the exception description: Nullable object must have a value (?!) This is the problem: I have a DateTimeExtended class, that has { DateTime? MyDataTime; int?...
  • May 24, 2022
  • 0 Comments
How can I convert the nullable DateTime dt2 to a formatted string? DateTime dt = DateTime.Now; Console.WriteLine(dt.ToString("yyyy-MM-dd hh:mm:ss")); //works DateTime? dt2 = DateTime.Now; Console.WriteLine(dt2.ToString("yyyy-MM-dd hh:mm:ss")); //gives following error: no...
  • May 21, 2022
  • 0 Comments