I have a data model like so
public class NewsItem
{
public virtual int Id { get; set; }
public virtual string NewsTitle { get; set; }
public
You'll want an input field of type file to upload from the View and an instance of the WebImage to handle the uploaded image:
View:
Controller:
WebImage image = WebImage.GetImageFromRequest();
byte[] toPutInDb = WebImage.GetBytes();
// ... put the byte array into the database
To display the images from your database, you will want a controller Action that retrieves the byte array from your database and returns a FileAction. You can get this image (for the image retrieving controller action) by instantiating another WebImage instance on the bytearray you retrieve from database:
WebImage image = new WebImage(byteArrayFromDb);
File(image.GetBytes(), "image/" + image.ImageFormat, image.FileName);