예제 #1
0
 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>()));
 }
예제 #2
0
 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;
 }