internal Business.User Map(UserRecord userRecord)
 {
     return(User.Existing(
                UserId.FromInt(userRecord.Id),
                Username.FromString(userRecord.Name),
                Age.FromInt(userRecord.Age)
                ));
 }
Exemple #2
0
        private void SaveNewUser(User user)
        {
            var userRecord = new UserRecord {
            };

            _userMapper.MapTo(user, userRecord);
            _context.Users.Add(userRecord);
            _context.SaveChanges();
            user.AssignId(UserId.FromInt(userRecord.Id));
        }