Skip to content

Instantly share code, notes, and snippets.

@justinyoo
Created June 17, 2016 06:06
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save justinyoo/e108fef7e0bbb757a83c394be48668a2 to your computer and use it in GitHub Desktop.
Save justinyoo/e108fef7e0bbb757a83c394be48668a2 to your computer and use it in GitHub Desktop.
Configuration Value Converter for enum and List<T>
public class ProductElement : ConfigurationElement
{
[ConfigurationProperty("types", IsRequired = true)]
[TypeConverter(typeof(PipeDelimitedFlaggedEnumConverter<ProductTypes>))]
public ProductTypes Types
{
get { return (ProductTypes)this["types"]; }
set { this["types"] = value; }
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment