Just having a few issues with inheritance in code-first entity framework.
I implemented inheritance using the code-first pattern (that is, I have a base class Request and other classes subclass it NewSpaceRequest.etc.
It seems that the framework/language doesn't provide much beyond this as far as functionality.
For instance, I wanted to have a view that had a list of all of the requests, with different text depending on the type of request. I couldn't work out an easy way to do that because I always had to typecast to Request, which means I lose all my subclass functionality and my ability to tell what class I had.
Anyway, I found a hacky way around this, and I have a list of requests in a view. I want to allow the user to click a link (one for each Request in the list) and be sent to an action that'll change depending on the type of request. The problem is that by this point all my requests are of type Request (I believe this is a requirement of foreach) so I have no idea what they really are.
It's just little issues like this that I keep running into when using inheritance with code-first. Am I doing something wrong?
Request?Requestis not an HttpRequest but a class you defined yourself, is it?