public static GameEventViewModel ToViewModel(this GameEventDto gameEventDto, GameEventPermission permission) => new GameEventViewModel( gameEventDto.Id, gameEventDto.Name, gameEventDto.Place, gameEventDto.Date, permission, gameEventDto.Games, gameEventDto.Creator.ToViewModel(), gameEventDto.Invitees.Select(u => u.ToViewModel()), gameEventDto.Participants.Select(u => u.ToViewModel()), gameEventDto.DescriptionTab.ToViewModel());
public GameEventViewModel( int id, string name, string place, DateTime?date, GameEventPermission permission, IEnumerable <string> games, UserViewModel creator, IEnumerable <UserViewModel> invitees, IEnumerable <UserViewModel> participants, DescriptionTabViewModel descriptionTab) { Id = id; Name = name; Place = place; Date = date; _permission = permission; Games = games; Creator = creator; Invitees = invitees; Participants = participants; DescriptionTab = descriptionTab; }