Is there a simple way to store methods in an EF table, akin to inheritance?
For example, I have a table representing apps on a portal page (kind of like your basic iphone or android home screen). I’d like to display a number by each app showing how many notifications the app has. However, the method to get the number of notifications varies greatly depending on the app.
My current solution is to just have a class containing all the methods I need, and then switch based on the app name. Is there a better way?
Assuming that your method to obtain the notifications is parameterless, you could store the method name in a column in that table and invoke it via reflection. For this example we’ll call the column/property NotificationMethodName.