Exemplo n.º 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));
        }
Exemplo n.º 2
0
        public async Task <IActionResult> Create(FriendLinkEditModel viewModel)
        {
            await _friendLinkService.AddAsync(viewModel.Title, viewModel.LinkUrl);

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

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