public static Profile ConvertFromDto(ProfileDTO profileDto)
 {
     return(new Profile(
                id: profileDto.Id,
                firstName: profileDto.FirstName,
                secondName: profileDto.SecondName,
                tasks: TaskMapper.ConvertFromListDto(profileDto.Tasks)?.ToList()));
 }
Example #2
0
        public async Task <IResponseWrapper> GetProfileTasks(int id)
        {
            try
            {
                var response = await localDataSource.GetProfileTasks(id);

                return(new Success <List <TaskEntity> >(TaskMapper.ConvertFromListDto(response).ToList()));
            }
            catch (Exception e)
            {
                Debug.WriteLine("[ProfileRepository.GetProfileTasks()] Error: " + e.Message);
                return(new Error(e.Message));
            }
        }