title: asp.net mvc 3: best way manage a model with an image
body: <p>I'm trying to find the best way to manage a model with an associated image.</p>
  
  <p>I don't know if is better to persiste the image in data store</p>
  
  <pre><code>class MyModel {
    ...
    public byte[] ImageData { get; set; }
    ...
  }
  </code></pre>
  
  <p>or save the Url and upload the image to filesystem</p>
  
  <pre><code>class MyModel {
    ...
    public string ImageUrl { get; set; }
    ...
  }
  </code></pre>
  
  <p>The essential thing is that I want manage the image in when I'm creating or editing the model record.</p>
  
  <p>I don't want a dedicated model/view/controller aimed to upload/persist the image to the server. I want manage the imaged linked to a specific entity in the db.</p>
  
  <p>Regards,
  Giacomo</p>