I need to write something like this in a generic way:
BUT the problem is that if I write the code in VS2012 will look like this instead: Categories c = (Categories)FormView1.DataItem;
Is not quite obvious the difference but it is a huge difference. Having "Categories" written in "black" are just "text"; written in "green" they are classes that can be instantiated
I'd like to find a way of converting strings into classes in the same way you call a funtion: passing text as arguments that can be treated as an object not as text.
In this case I'd like to convert "Categories" (text) to (a class
representing my entity Categories in my database)
klca
Member
509 Points
421 Posts
Converting a string/text into a class
Dec 04, 2012 08:05 PM|LINK
Hi,
I need to write something like this in a generic way:
BUT the problem is that if I write the code in VS2012 will look like this instead: Categories c = (Categories)FormView1.DataItem;
Is not quite obvious the difference but it is a huge difference. Having "Categories" written in "black" are just "text"; written in "green" they are classes that can be instantiated
I'd like to find a way of converting strings into classes in the same way you call a funtion: passing text as arguments that can be treated as an object not as text.
In this case I'd like to convert "Categories" (text) to
(a class
representing my entity Categories in my database)
Carlos N. Porras
(El Salvador)
sjnaughton
All-Star
27391 Points
5485 Posts
MVP
Re: Converting a string/text into a class
Dec 04, 2012 08:53 PM|LINK
HI Carlos, try having a look at N41 DynamicData Extender this has some feature that will get an entity for you.
Always seeking an elegant solution.
klca
Member
509 Points
421 Posts
Re: Converting a string/text into a class
Dec 06, 2012 07:02 AM|LINK
Hi,
N41 .... :( couldn't find a clue ... !
Carlos N. Porras
(El Salvador)
sjnaughton
All-Star
27391 Points
5485 Posts
MVP
Re: Converting a string/text into a class
Dec 06, 2012 11:01 AM|LINK
I'll try and dig the bit I think you need out over the weekend and post it here.
Always seeking an elegant solution.