我需要一些帮助来指导我如何使用ASP.NET C#在Oracle的BLOB字段中上载/保存图像文件
using System.Web;
namespace ErpScoop.Models
{
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.Spatial;
[Table("SCOOP_APP.EMPLOYEE")]
public partial class Employee
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public decimal EMP_ID { get; set; }
[StringLength(200)]
public string EMP_FULL_NAME { get; set; }
[Display(Name = "Change Image")]
public byte[] EMP_PHOTO { get; set; }
}
}
这是控制者
[HttpPost]
[ValidateAntiForgeryToken]
public ActionResult Create([Bind(Include = "EMP_ID,EMP_FULL_NAME,EMP_PHOTO")] Employee employee, HttpPostedFileBase imageProfile)
{
if (ModelState.IsValid)
{
db.EMPLOYEEs.Add(employee);
db.SaveChanges();
return RedirectToAction("Index");
}
return View(employee);
}