//look up the attribute matching the listid using Reflection and LINQ Type dtoType = typeof(AppInitParamsDTO); PropertyInfo pi = dtoType.GetProperties(BindingFlags.Instance | BindingFlags.Public) .Where( x => typeof(AppInitParamsSettingsListNameAttribute) .GetProperty("ListName") .GetValue(Attribute.GetCustomAttribute( x, typeof(AppInitParamsSettingsListNameAttribute)), null).ToString() == listId).First();
Replace nested-if's with proper exception-handling
-
" Why handle exceptions separately:
■ Handling exceptions separately enables you to define the main logic of
your
code together.
■ Without the use of sepa...
2 years ago
No comments:
Post a Comment