Example #1
0
        public static IUser User(UserEntity userEntity)
        {
            ActivateValidations();
            IUser currentUser = new User(userEntity.FirstName, userEntity.LastName, userEntity.Password, userEntity.EmailAddress, userEntity.DateOfBirth);
            currentUser.Id = userEntity.Id;
            //foreach (TaskEntity createdTask in userEntity.CreatedTasks)
            //{
            //    currentUser.CreatedTasks.Add(Task(createdTask));
            //}

            //foreach (TaskEntity assignedTask in userEntity.AssignedTasks)
            //{
            //    currentUser.AssignedTasks.Add(Task(assignedTask));
            //}

            DeactivateValidations();
            return currentUser;
        }
Example #2
0
        public static UserEntity UserEntity(IUser user)
        {
            DeactivateValidations();
            UserEntity entity = new UserEntity()
            {
                Id = user.Id,
                FirstName = user.FirstName,
                LastName = user.LastName,
                Password = user.Password,
                EmailAddress = user.EmailAddress,
                DateOfBirth = user.DateOfBirth
            };

            //foreach (ITask createdTask in user.CreatedTasks)
            //{
            //    entity.CreatedTasks.Add(TaskEntity(createdTask));
            //}

            //foreach (ITask assignedTask in user.AssignedTasks)
            //{
            //    entity.AssignedTasks.Add(TaskEntity(assignedTask));
            //}

            ActivateValidations();
            return entity;
        }