示例#1
0
        public async Task <IActionResult> PostFavouriteAsync([FromBody] FavouriteDTO favouriteDTO)
        {
            await Task.Yield();

            try
            {
                var favourite = favouriteDTO.ToEntity();
                var user      = await userLogic.AddFavouriteAsync(favourite).ConfigureAwait(false);

                return(Ok(new UserDTO(user)));
            }
            catch (Exception e)
            {
                return(BadRequest(e.Message));
            }
        }