Example #1
0
 /// <summary>
 /// Return a single user
 /// </summary>
 /// <param name="user"></param>
 /// <returns></returns>
 private static UserDto MapUsersToDto(Users user) {
     return new UserDto {
         UserId = user.UserID,
         Age = user.Age,
         Name = user.Name,
         AddedOn = user.AddedOn
     };
 }
Example #2
0
 public static void CreateUser(UserDto userDto) {
     using(var uow = new UnitOfWork()) {
         var userDe = new Users();
         MapUserToDe(userDto,userDe);
         userDe.AddedOn = DateTime.Now;
         uow.UsersRepository.Insert(userDe);
         uow.Save();
     }
 }
Example #3
0
 private static void MapUserToDe(UserDto userDto, Users userDe) {
     userDe.UserID = userDto.UserId;
     userDe.Name = userDto.Name;
     userDe.Age = userDto.Age;
 }