public static void Main()
var request = new Test { ServiceType = "DDC/Hotel" };
var serviceType = request.ServiceType switch
PetServiceTypeValues.DdcOrHotel => PetServiceType.DdcOrHotel,
PetServiceTypeValues.Salon => PetServiceType.Salon,
PetServiceTypeValues.Training => PetServiceType.Training,
_ => PetServiceType.Unknown
Console.WriteLine(serviceType.ToString());
public string ServiceType { get; set; }
public enum PetServiceType
public static class PetServiceTypeValues
public const string DdcOrHotel = "DDC/Hotel";
public const string Salon = "Uff";
public const string Training = "Training";