public ModeloDeCadastroDePost(Post post, ModeloDeListaDeTags tags) : this() { if (post != null) { this.Titulo = post.Titulo; this.Conteudo = post.Conteudo; this.PermiteComentarios = post.PermiteComentarios; } this.Tags = tags; }
public ModeloDeEdicaoDePost(Post post, ModeloDeListaDeTags tags) : this() { if (post != null) { this.Id = post.Id; this.Titulo = post.Titulo; this.Conteudo = post.Conteudo; this.PermiteComentarios = post.PermiteComentarios; foreach (var tag in tags.Tags) { if (post.Tags.FirstOrDefault(t => t.Nome == tag.Nome && t.Id == tag.Id) != null) { tag.Ativa = true; } } } this.Tags = tags; }