My issue is that when I try to choose the rarity of the item, which is an enum that cosists of {common, uncommon, rare, legendary, …}, I get the following problem:
instead of itemData*[“rarity”]* edit unfortunately you can’t add extension methods to “types” only to “instances”. You could add this class to your project: public static class EnumExtension { public static T Parse(this System.Enum aEnum, string aText) { return (T)System.Enum.Parse(typeof(T), aText); } } It will add the Parse method to each enum value. So you could simply do: Rarity.common.Parse(itemData*[“rarity”])* It doesn’t matter which enum member you use. Of course instead of an extension method you could simply place the method in a helper class: public static class Helper { public static T ParseEnum(string aText) { return (T)System.Enum.Parse(typeof(T), aText); } } This can be used like this: Helper.ParseEnum(itemData*[“rarity”])*