If I have, say, a movie table, among other things, there is an int FilmTypeId field and a movie type table with an identifier and a meaningful description in the lines:
What is the best way to use this information in a C # class?
I would currently use them as constants in the helper class (unmistakably air code):
public class FilmHelper
{
public const int HorrorFilmType = 1;
public const int ComedyFilmType = 2;
...
}
but this does not seem to be supported. But I would like to avoid calling the database every time I came to use a constant or extra db call every time I used either helper or main object.
source
share