Hi Guys I am trying to Display the images from database I save the images in the database but it not display any thing how can i fix this here in my Code
this is my model view
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Linq;
using System.Web;
namespace Archive.Models
{
    public class Inbox
    {
        [Key]
        public int Id { get; set; }
        public IEnumerable<HttpPostedFileBase> Files { get; set; }
        public ApplicationUser User { get; set; }
        public object UserId { get; internal set; }
    }
}
and here details
    namespace Archive.Models
{
    public class AllFiles
    {
        public int Id { get; set; }
        public string ContentType{ get; set; }
        public byte[] Imagebytes { get; set; }
    }
}
here i Convert
using System.Web;
using System.IO;
namespace FileUpload.Service
{
    public class FileUploadService
    {
        // GET: AllFiles
        public void saveFileDetails(HttpPostedFileBase file)
        {
            AllFiles newfile = new AllFiles();
            newfile.ContentType = file.ContentType;
            newfile.Imagebytes = ConvertToBytes(file);
            ApplicationDbContext db = new ApplicationDbContext();
            {
                db.AllFiless.Add(newfile);
                db.SaveChanges();      
            }
        }
        public byte[] ConvertToBytes(HttpPostedFileBase file)
        {
            byte[] imagebytes = null;
            BinaryReader reader = new BinaryReader(file.InputStream);
            imagebytes = reader.ReadBytes((int)file.ContentLength);
            return imagebytes;
        }
    }
}
and here is my Controller
        public async Task<ActionResult> Create(Inbox model)
    {
        var currentUser = await manager.FindByIdAsync(User.Identity.GetUserId());
        if (ModelState.IsValid)
        {
            model.User = currentUser;
            FileUploadService service = new FileUploadService();
            foreach (var item in model.Files)
            {
                service.saveFileDetails(item);
            }
                var max = new Inbox();
            db.Inboxs.Add(model);
            db.SaveChanges();
            string url = Url.Action("List");
            return Json(new { success = true, url = url });
        }
        return View(model);
    }
and this is my view details
    @foreach(var image in Model)
{
    var base64 = Convert.ToBase64String(image.Files);
    var imgSrc = String.Format("data:{0};base64,{1}",image.ContentType ,base64);
    <img src="@imgSrc"/>
}
i am try to display images here but is not show up what is problem guys please guys i am trying this so hard i asked here but i did't get the images
the image in database it saved like this here