public static GetDeckResponse FromDeckEntity(Deck deck) { var deckResponse = new GetDeckResponse { DeckId = deck.DeckId , Title = deck.Title , Description = deck.Description , CreatedAt = deck.CreatedAt , UpdatedAt = deck.UpdatedAt , Cards = deck.CardDecks.Select(cd => GetCardResponse.FromCardEntity(cd.Card)).ToList() }; return(deckResponse); }
public static IList <GetDeckResponse> FromDeckEntity(List <Deck> decks) => decks.Select(d => GetDeckResponse.FromDeckEntity(d)).ToList();