public Picture ExtractPicture(HttpPostedFileBase postedFile)
        {
            Picture image = null;

            using (var memory = new MemoryStream())
            {
                postedFile.InputStream.CopyTo(memory);
                var content = memory.GetBuffer();

                image = new Picture
                {
                    Content = content,
                    FileExtension = postedFile.FileName.Split(new[] { '.' }).Last()
                };
            }

            return image;
        }
 public void Create(Picture picture)
 {
     this.pictures.Add(picture);
     this.pictures.SaveChanges();
 }