Answers for "how to create a subset of enum c#"

C#
1

how to create a subset of enum c#

public enum MasterEnumAnimal {
   Dog       = 1,
   Cat       = 2,
   Bird      = 3,
   Alligator = 4,
   Camel     = 5
  }

// Subset
public enum Pet {
   Dog  = MasterEnumAnimal.Dog,
   Cat  = MasterEnumAnimal.Cat,
   Bird = MasterEnumAnimal.Bird
}
Posted by: Guest on July-01-2020

C# Answers by Framework

Browse Popular Code Answers by Language