public Task <bool> DeletePostAsync(string key, string postid, string username, string password, bool publish) { EnsureUser(username, password); return(TryExecuteAsync(async() => { if (!Guid.TryParse(postid.Trim(), out var id)) { throw new ArgumentException("Invalid ID", nameof(postid)); } await _postManageService.DeleteAsync(id, publish); return true; })); }
public async Task <IActionResult> Delete([NotEmpty] Guid postId) { await _postManageService.DeleteAsync(postId, true); return(NoContent()); }