I want to create a FormFile in my seed function. But I get a null reference exception. Here my code
FileStream fs = new FileStream("testfile.jpg", FileMode.Open, FileAccess.Read);
FormFile file = new FormFile(fs, 1024, fs.Length, "testfile", "testfile.jpg");
file.ContentType = "image/jpeg";
The null reference occurs when I am trying to set content type. Any Ideas what I am making wrong? Checked before with File.Exists which returns true.