如何解决如果模型中有文件,则存储临时模态数据的最佳解决方案.Net Core
我有与客户合作的应用程序,在添加新客户页面中,可以选择在添加文件后附加与客户相关的文件我想在网格中显示它,因为他可以添加多个文件 之后他可以将客户数据与文件一起保存在数据库中。
我的问题是在 Action 中接收数据后将数据模型添加为 Temp 的最佳解决方案是什么,可能是在添加一些文件后他会取消请求,或者他可能会转到其他页面。
我尝试使用 session but field 因为有 IFormFile 字段。
以下是我的模型
public class CustomerFileViewModel
{
public int Id { get; set; }
public string Description { get; set; }
public string Name { get; set; }
public string FileType { get; set; }
public IFormFile DataFiles { get; set; }
}
以下是我在控制器中的动作
[HttpPost]
public ActionResult AddFileTempItem(CustomerFileViewModel model)
{
//Code here ???
}
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。