Exemple #1
0
        private AppUserAppUserMapping ConvertDTOToEntity(AppUser_AppUserAppUserMappingDTO AppUser_AppUserAppUserMappingDTO)
        {
            AppUserAppUserMapping AppUserAppUserMapping = new AppUserAppUserMapping
            {
                AppUserId = AppUser_AppUserAppUserMappingDTO.AppUserId,
                FriendId  = AppUser_AppUserAppUserMappingDTO.FriendId,
            };

            return(AppUserAppUserMapping);
        }
Exemple #2
0
        public async Task <ActionResult <AppUser_AppUserAppUserMappingDTO> > AcceptFriendRequest([FromBody] AppUser_AppUserAppUserMappingDTO AppUser_AppUserAppUserMappingDTO)
        {
            if (!ModelState.IsValid)
            {
                throw new BindException(ModelState);
            }
            if (!await HasPermission(AppUser_AppUserAppUserMappingDTO.FriendId))
            {
                return(Forbid());
            }

            var AppUserAppUserMapping = ConvertDTOToEntity(AppUser_AppUserAppUserMappingDTO);

            AppUserAppUserMapping = await AppUserService.AcceptFriendRequest(AppUserAppUserMapping);

            AppUser_AppUserAppUserMappingDTO = new AppUser_AppUserAppUserMappingDTO(AppUserAppUserMapping);
            return(AppUser_AppUserAppUserMappingDTO);
        }