Quantcast
Channel: ASP.NET Core
Viewing all articles
Browse latest Browse all 9386

save file to database using IFormFile as datatype

$
0
0

using System.ComponentModel.DataAnnotations;
using Microsoft.AspNet.Http;

namespace tamam.Models
{
public class User
{
[Required]
[MinLength(4)]
public string Name { get; set; }
public string Address { get; set; }
public int Age { get; set; }
[Required]
[FileExtensions(Extensions = "jpg,jpeg")]
public IFormFile File { get; set; }

}
}

when i create a controller, the following error appear 

error:

there was an error running the selected code generator:

the property 'file' on entity type 'xxx' has not been added to the model or ignored


Viewing all articles
Browse latest Browse all 9386

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>