Skip to main content

Practice ยท 2 of 3

Map Rows to Objects

CHALLENGE
Difficulty: intermediate+25 XP

Implement LoadUsers: read all users and map each row (columns "name" string, "age" int, "balance" decimal) into User records, sorted by name. Rows may contain null age โ€” map null to 0. ``csharp public sealed record User(string Name, int Age, decimal Balance); static System.Collections.Generic.List<Solution.User> LoadUsers(CjDb db); ``

Back to lesson: Practice: Data Practice: Parameters, Mapping, Transactions