InvalidEnumException.cs 421 B

1234567891011121314151617181920
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Text;
  4. namespace InABox.Core
  5. {
  6. public class InvalidEnumException<T> : Exception
  7. where T : Enum
  8. {
  9. public InvalidEnumException(T value) : base($"Invalid value {value} for enum {typeof(T).Name}")
  10. {
  11. }
  12. public InvalidEnumException() : base($"Invalid value for enum {typeof(T).Name}")
  13. {
  14. }
  15. }
  16. }