In our business application we handle images and videos. I have created the Entity Framework model based on this answer:
https://stackoverflow.com/a/6241232/3850405
I know this will result in varbinary(MAX)
which has a limit to around 2 GB since EF does not support FILESTREAM
out of the box.
https://stackoverflow.com/a/5723825/3850405
What I can't find however is what the recommended maximum file size is? I know that this could fall under opinion based but I hope that the given context allows it. For images I was thinking around 5 mb and videos 200 mb and only fetch them when the user want's to see them (Name will be showed in Front End).
Is this a good solution or should I rethink this all together? Would it be beneficial to implement FILESTREAM
even though it is not supported by default?
Current model:
public class Media
{
[Key]
public int Id { get; set; }
public DateTime Created { get; set; }
public DateTime Updated { get; set; }
public virtual ICollection<Image> Images { get; set; }
public virtual ICollection<Video> Videos { get; set; }
}
public class Image
{
[Key]
public int Id { get; set; }
public DateTime Created { get; set; }
public DateTime Updated { get; set; }
public string Name { get; set; }
public virtual byte[] Image { get; set; }
public int MediaId { get; set; }
public virtual Media Media { get; set; }
}
public class Video
{
[Key]
public int Id { get; set; }
public DateTime Created { get; set; }
public DateTime Updated { get; set; }
public string Name { get; set; }
public virtual byte[] Video { get; set; }
public int MediaId { get; set; }
public virtual Media Media { get; set; }
}