public static NoteDTO FromNote(Note note) { return(new NoteDTO( note.Id, note.Title ?? string.Empty, note.Content ?? string.Empty, CreatorOverviewDTO.FromAuthor(note.Creator), note.DateCreated, note.LastModified, note.Contributors?.Select(ContributorOverviewDTO.FromAuthor) ?? Enumerable.Empty <ContributorOverviewDTO>())); }
public NoteDTO(int id, string title, string content, CreatorOverviewDTO creator, DateTime dateCreated, DateTime lastModified, IEnumerable <ContributorOverviewDTO> contributors) { this.Id = id; this.Title = title; this.Content = content; this.Creator = creator; this.DateCreated = dateCreated; this.Contributors = contributors; _lastModified = lastModified; }