Example #1
0
        public ICollection <UserDTO> GetFollowersById(string id)
        {
            var followers = _dataBase.Profiles.GetByIdWithFollowers(id).Followers;
            var dto       = CustomMapperBLL.FromClientProfileToUserDTO(followers);

            return(dto);
        }
Example #2
0
        public UserDTO GetUserById(string id)
        {
            var appUser = _dataBase.UserManager.FindById(id);
            var userDto = CustomMapperBLL.FromClientProfileToUserDTO(_dataBase.Profiles.GetById(id), false);

            userDto.Email       = appUser.Email;
            userDto.PhoneNumber = appUser.PhoneNumber;
            return(userDto);
        }
Example #3
0
        public UserDTO GetUserByEmail(string email)
        {
            var appUser = _dataBase.UserManager.FindByEmail(email);
            var userDto = CustomMapperBLL.FromClientProfileToUserDTO(_dataBase.Profiles.GetById(appUser.Id), false);

            userDto.Email       = appUser.Email;
            userDto.Role        = _dataBase.RoleManager.FindById(appUser.Roles.First().RoleId).Name;
            userDto.PhoneNumber = appUser.PhoneNumber;

            return(userDto);
        }
Example #4
0
        public ICollection <PublicationDTO> GetPublicationsByUserIdHome(string userId)
        {
            var publications = _dataBase.Profiles.GetByIdWithPublications(userId).Publications;
            var result       = new List <PublicationDTO>();

            foreach (var p in publications)
            {
                result.Add(CustomMapperBLL.FromPublucationToPublicationDTO(_dataBase.Publications.GetById(p.Id), false));
            }

            return(result);
        }
Example #5
0
        public ICollection <PublicationDTO> GetPublicationsByUserIdMain(string id)
        {
            var users = _dataBase.Profiles.GetByIdWithFollowing(id).Following;
            IEnumerable <PublicationDTO> publication = new List <PublicationDTO>();

            foreach (var f in users)
            {
                var publ = _dataBase.Profiles.GetByIdWithPublications(f.Id).Publications;
                publication = publication.Union(CustomMapperBLL.FromPublucationToPublicationDTO(publ));
            }
            return(publication.OrderByDescending(x => x.DateOfCreate).ToList());
        }
        //from message to messageDto check after
        public ICollection <MessageHeaderDTO> GetMessageHeadersByUserEmail(string email)
        {
            var userId = _dataBase.UserManager.FindByEmailAsync(email).Result.Id;

            var messageHeaders   = _dataBase.Profiles.GetByIdWithMessageHeaders(userId).MessageHeaders;
            var messageHeaderDTO = new List <MessageHeaderDTO>();

            foreach (var m in messageHeaders)
            {
                messageHeaderDTO.Add(CustomMapperBLL.FromMessageHeaderToMessageHeaderDTO(_dataBase.MessageHeaders.GetById(m.Id), false));
            }
            return(messageHeaderDTO);
        }
Example #7
0
        public PublicationDTO GetById(int id)
        {
            var publication = _dataBase.Publications.GetById(id);

            return(CustomMapperBLL.FromPublucationToPublicationDTO(publication, false));
        }
Example #8
0
        public ICollection <UserDTO> GetUsersWhoLike(int id)
        {
            var users = _dataBase.Publications.GetById(id).UsersWhoLike;

            return(CustomMapperBLL.FromClientProfileToUserDTO(users));
        }
 public ICollection <RelationshipDTO> GetRelationship()
 {
     return(CustomMapperBLL.FromRelationshipToRelationshipDTO(_dataBase.Additionals.GetRelationship()));
 }
 public ICollection <MessageHeaderTypeDTO> GetMessageHeaderTypes()
 {
     return(CustomMapperBLL.FromMessageHeaderTypeToMessageHeaderTypeDTO(_dataBase.Additionals.GetMessageHeaderTypes()));
 }
 public ICollection <CountryDTO> GetCountry()
 {
     return(CustomMapperBLL.FromCountryToCountryDTO(_dataBase.Additionals.GetCountry()));
 }
Example #12
0
        public ICollection <UserDTO> GetFollowingById(string id)
        {
            var following = _dataBase.Profiles.GetByIdWithFollowing(id).Following;

            return(CustomMapperBLL.FromClientProfileToUserDTO(following));
        }
        public MessageHeaderDTO GetById(int id)
        {
            var messageHeader = _dataBase.MessageHeaders.GetById(id);

            return(CustomMapperBLL.FromMessageHeaderToMessageHeaderDTO(messageHeader, false));
        }
Example #14
0
        public ICollection <UserDTO> GetUsersByCity(string city)
        {
            var users = _dataBase.Profiles.Find(x => x.City.Name == city);

            return(CustomMapperBLL.FromClientProfileToUserDTO(users));
        }
Example #15
0
        public ICollection <UserDTO> GetAll()
        {
            var users = _dataBase.Profiles.GetAll();

            return(CustomMapperBLL.FromClientProfileToUserDTO(users));
        }
        public ICollection <MessageDTO> GetByHeaderId(int headerId)
        {
            var messageSource = _dataBase.MessageHeaders.GetById(headerId).Messages;

            return(CustomMapperBLL.FromMessageToMessageDTO(messageSource).OrderByDescending(x => x.DateTimeSend).ToList());
        }
 public ICollection <CityDTO> GetCity()
 {
     return(CustomMapperBLL.FromCityToCityDTO(_dataBase.Additionals.GetCity()));
 }