public async Task <IActionResult> Create([FromBody] CreateSocialMediaDto model) { if (!ModelState.IsValid) { return(BadRequest()); } await _socialMediaService.CreateSocialMedia(model); return(Ok()); }
public async Task <IActionResult> Post([FromBody] CreateSocialMediaDto model) { if (!ModelState.IsValid) { return(BadRequest()); } IdentityResult result = await _socialMediaService.CreateSocialMedia(model); if (result.Succeeded) { return(Ok(result)); } return(BadRequest(result.Errors.Select(x => x.Description))); }