Exemple #1
0
        public SportEventDetailDTO MapToDTO(SportEvent source)
        {
            SportEventDetailDTO target = new SportEventDetailDTO();

            target.Id          = source.Id;
            target.Date        = source.Date;
            target.Description = source.Description;
            target.Title       = source.Title;
            target.ImagePath   = source.ImagePath;

            AccountMapper accountMapper = new AccountMapper();

            target.Owner = accountMapper.MapToDTO(source.Owner);

            AdressMapper adressMapper = new AdressMapper();

            target.Adress = adressMapper.MapToDTO(source.Adress);

            SportMapper sportMapper = new SportMapper();

            target.Category = sportMapper.MapToDTO(source.Category);

            AccountSimpleMapper accountSimpleMapper = new AccountSimpleMapper();

            target.Attendees = new HashSet <AccountSimpleDTO>();

            foreach (var ac in source.Attendees)
            {
                target.Attendees.Add(accountSimpleMapper.MapToDTO(ac));
            }

            return(target);
        }
        public FriendDTO MapToDTO(Account source)
        {
            FriendDTO target = new FriendDTO();

            target.Id       = source.Id;
            target.FullName = source.LastName + " " + source.FirstName;
            target.Email    = source.Email;
            target.UserName = source.UserName;

            AdressMapper adressMapper = new AdressMapper();

            target.Adress = adressMapper.MapToDTO(source.Adress);

            return(target);
        }
        public SignUpAccountDTO MapToDTO(Account source)
        {
            SignUpAccountDTO target = new SignUpAccountDTO();

            target.Id        = source.Id;
            target.FirstName = source.FirstName;
            target.LastName  = source.LastName;
            target.UserName  = source.UserName;
            target.Email     = source.Email;
            target.Password  = source.UserPassword;
            AdressMapper adressMapper = new AdressMapper();

            target.Adress = adressMapper.MapToDTO(source.Adress);
            return(target);
        }
        public AccountDTO  MapToDTO(Account source)
        {
            AccountDTO target = new AccountDTO();

            target.Id       = source.Id;
            target.FullName = source.LastName + " " + source.FirstName;
            target.Email    = source.Email;
            target.UserName = source.UserName;

            if (source.Adress != null)
            {
                AdressMapper adressMapper = new AdressMapper();
                target.Adress = adressMapper.MapToDTO(source.Adress);
            }


            return(target);
        }
Exemple #5
0
        public SportEventDTO MapToDTO(SportEvent source)
        {
            SportEventDTO target = new SportEventDTO();

            target.Id          = source.Id;
            target.Date        = source.Date;
            target.Description = source.Description;
            target.Title       = source.Title;
            target.ImagePath   = source.ImagePath;

            AccountMapper accountMapper = new AccountMapper();

            target.Owner = accountMapper.MapToDTO(source.Owner);

            AdressMapper adressMapper = new AdressMapper();

            target.Adress = adressMapper.MapToDTO(source.Adress);

            SportMapper sportMapper = new SportMapper();

            target.Category = sportMapper.MapToDTO(source.Category);

            return(target);
        }