public Comment MapData(CommentModel m, int p) { Comment c = new Comment(); c.Id = m.Id; c.Text = m.Text; c.Titel = m.Titel; c.Url = m.Url; c.VacationId = p; return c; }
public ICollection<CommentModel> MapData(ICollection<Comment> comments) { ICollection<CommentModel> commentModels = new List<CommentModel>(); if (comments != null) { foreach (Comment c in comments) { CommentModel m = new CommentModel(); m.Id = c.Id; m.Titel = c.Titel; m.Text = c.Text; m.Url = c.Url; m.VacId = c.VacationId; commentModels.Add(m); } } return commentModels; }