3
I’m trying to develop a web system that works as a message-oriented social network.
Having the classes usuario.cs
and Informacao.cs
(which acts as a message), need to provide attachments in this information, the messages are disclosed on each user’s page, as pages of a blog. A user can send several files along with the message to another user, the part of the messages I already have, what I need now is to implement the attachments.
The user should be able to send attachments in their messages and download attachments in other messages.
What kind of attribute do I need? What’s more "healthy" for the system, files saved in the database, or files saved in a reserved directory?
I don’t want the whole controller code ready, I just need directions, what kind of attribute to use, precautions, tips the cleanest way to do this, that kind of help.
Informacao.Cs
public class Informacao
{
[Key]
public int InformacaoID { get; set; }
[Required(ErrorMessage = "Digite algo.")]
public String Mensagem { get; set; }
public virtual Usuario Autor { get; set; }
[Required]
public DateTime DataPublicacao { get; set; }
}