Exemple #1
0
        public async Task <IActionResult> CreateFriendLink([FromBody] FriendLinkEditViewModel viewModel)
        {
            if (!ModelState.IsValid)
            {
                return(BadRequest(ModelState));
            }

            await _friendLinkService.AddAsync(viewModel.Title, viewModel.LinkUrl);

            return(Ok(viewModel));
        }
Exemple #2
0
        public async Task <IActionResult> Create(FriendLinkEditModel viewModel)
        {
            await _friendLinkService.AddAsync(viewModel.Title, viewModel.LinkUrl);

            return(Ok(viewModel));
        }
        public async Task <IActionResult> Create(FriendLinkEditModel model)
        {
            await _friendLinkService.AddAsync(model.Title, model.LinkUrl);

            return(Created(string.Empty, model));
        }