using System.Collections.Generic;
public static void Main()
var defaultError = new DefaultError();
defaultError.ErrorType = ValidationErrorType.SkuCodeDuplicateByUser;
switch (defaultError?.ErrorType) {
case ValidationErrorType.SkuCodeDuplicateByUser:
case ValidationErrorType.SkuCodeDuplicateBySupplier:
Console.WriteLine("Hit Exception");
throw new Exception($"Please update the Name");
Console.WriteLine("Hit default");
Console.WriteLine("SUCCESS");
public class DefaultError
public ValidationErrorType ErrorType { get; set; }
public enum ValidationErrorType
SkuCodeDuplicateBySupplier,