Answers for "initialize enum with another enum c#"

C#
0

initialize enum with another 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