Exemple #1
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);
        }