public async Task VerifyDeleteReturnQueryStringAdditionalParam() { var result = await SimpleClient.DeleteAsync <JObject>("https://localhost:5001/api/return-query-additional/path-param/?foo=bar"); Assert.Equal("bar", result["foo"]); Assert.Equal("path-param", result["additional"]); }
public async Task VerifyTableResultsForDelete() { var response = await SimpleClient.DeleteAsync <JArray>("https://localhost:5001/api/table"); var list = response.Children().ToArray(); Assert.Equal(1, list[0]["id"]); Assert.Equal("a", list[0]["name"]); Assert.Equal(2, list[1]["id"]); Assert.Equal("b", list[1]["name"]); Assert.Equal(3, list[2]["id"]); Assert.Equal("c", list[2]["name"]); }
public async Task VerifyDeleteReturnQueryString() { var result = await SimpleClient.DeleteAsync("https://localhost:5001/api/return-query?1=2", new Query(new { key1 = "value1", key2 = "value2", foo = "bar" })); Assert.Equal("value1", result["key1"]); Assert.Equal("value2", result["key2"]); Assert.Equal("bar", result["foo"]); Assert.Equal("2", result["1"]); }
public async Task VerifyDeleteMatchByQueryStringNameResults() { var result = await SimpleClient.DeleteAsync("https://localhost:5001/api/values-from-params", query : new Query(new { _int = 999, _text = "foobar", _timestamp = "2019-05-19" })); Assert.Equal(999, result["first"]); Assert.Equal("foobar", result["second"]); Assert.Equal("2019-05-19T00:00:00", result["third"]); Assert.Null((string)result["fourth"]); }
public async Task <long> DeleteAsync(Expression <Func <TEntity, bool> > where, CancellationToken cancellationToken = default(CancellationToken)) { var result = await _dbSet.DeleteAsync(where); return(1); }