0

I have an image model and with it are a set of sizes that the image can be resized to that consist of a string name and the max height/width for that size.

My initial thought was to put it in the database and create a model for image sizes, but this seems like overkill and this would be called fairly often and not changed very often.

So I thought I could store it as a form of static data (a list of an ImageSize class or something), but I'm not sure where in the Controller to put this.

Where should I put this data?

Jane Panda
  • 1,591
  • 4
  • 23
  • 51

2 Answers2

3

You could create another class holding your static data then add the using statement in your Controller class to read the data inside of that class.

My Stack Overfloweth
  • 4,729
  • 4
  • 25
  • 42
1

You can use your web.config file for storing static data. You can also use xml file or application variables for this purpose.

But I would have preferred the web.config file.

More details

IIS and Static content?

Community
  • 1
  • 1
शेखर
  • 17,412
  • 13
  • 61
  • 117