in my webapp i use dataannotations validation in partial metadata class.
in web.config i have appsetttings - key customer
how can i change validation based on the key customer in web.config
or can i assign different partial class to my entity e.g. computer
something like
if customer = "c1" then
partial class computermetadatac1
else
partial class computermetadatac2
Member
60 Points
117 Posts
dataannotations coditional web.config appsettings
Feb 01, 2014 12:19 PM|orimaspnet|LINK
Hi,
in my webapp i use dataannotations validation in partial metadata class.
in web.config i have appsetttings - key customer
how can i change validation based on the key customer in web.config
or can i assign different partial class to my entity e.g. computer
something like
if customer = "c1" then
partial class computermetadatac1
else
partial class computermetadatac2
Thanks
All-Star
17916 Points
5681 Posts
MVP
Re: dataannotations coditional web.config appsettings
Feb 02, 2014 12:05 PM|sjnaughton|LINK
You should be able to just use the
to get a value from the web.config
Always seeking an elegant solution.