本文整理汇总了C#中JsonServiceClient.Delete方法的典型用法代码示例。如果您正苦于以下问题:C# JsonServiceClient.Delete方法的具体用法?C# JsonServiceClient.Delete怎么用?C# JsonServiceClient.Delete使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类JsonServiceClient
的用法示例。
在下文中一共展示了JsonServiceClient.Delete方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Test12
void Test12(JsonServiceClient client)
{
Console.WriteLine("~~~~~ DeleteUser (newuser3) ~~~~~~~~~");
UserResponse response = client.Delete<XamarinEvolveSSLibrary.UserResponse>("User/newuser3");
Console.WriteLine("Expected null: " + response.Exception);
Console.WriteLine();
}
示例2: TryLogin
public void TryLogin()
{
using(var tempDb = new TempFile())
{
//GlobalProxySelection.Select = new WebProxy("127.0.0.1", 8888); // proxy via Fiddler2.
using (var server = new Server() { Port = 8000, SqliteFile = tempDb.Path })
{
server.Start();
// log in
var restClient = new JsonServiceClient(FakeServer.BaseUri);
var response = restClient.Post<AuthResponseEx>(
"/api/auth/credentials?format=json",
new Auth()
{
UserName = "tech",
Password = "radar",
RememberMe = true
});
response.SessionId.ShouldMatch(@"[a-zA-Z0-9=+/]{20,100}");
response.UserName.ShouldBe("tech");
response.UserId.ShouldMatch(@"^[a-zA-Z0-9_-]{8}$");
// log out
var logoutResponse = restClient.Delete<AuthResponse>("/api/auth/credentials?format=json&UserName=tech");
logoutResponse.SessionId.ShouldBe(null);
// can't come up with a good way to verify that we logged out.
}
}
}
示例3: Delete
public ActionResult Delete(Models.Translation model)
{
using (var client = new JsonServiceClient())
{
var deleteUrl = new Uri(Request.Url, string.Format("/api/translation/{0}/{1}", model.Alpha2, model.Language));
var response = client.Delete<Api.Messages.TranslationResponse>(deleteUrl.ToString());
}
return Redirect("Index");
}
示例4: Delete_Click
private void Delete_Click(object sender, EventArgs e)
{
if (CurrentId == default(long)) return;
var client = new JsonServiceClient(BaseUrl);
client.Delete(new Customer {Id = CurrentId});
RefereshCustomerList();
}
示例5: Delete_SingleClient
private void Delete_SingleClient(int batchSize)
{
var timer = new Stopwatch();
timer.Start();
using (var client = new JsonServiceClient(ServiceAddress))
{
for (int i = 0; i < batchSize; i++)
{
client.Delete<DataResponse>(new DataRequest());
}
}
timer.Stop();
Console.WriteLine("{0} took {1} ms, BatchSize: {2}", "Delete_SingleClient", timer.ElapsedMilliseconds, batchSize);
}
示例6: Main
private static void Main()
{
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
// PerformanceTest();
var client = new JsonServiceClient(Settings.Default.ServiceAddress);
var createRequest = new CreateClientRequest
{
Email = "[email protected]"
};
var response = client.Post<ClientResponse>(createRequest);
Console.WriteLine("POST Response: {0}\n", response);
var updateRequest = new UpdateClientRequest
{
Email = "[email protected]",
Id = response.Id
};
response = client.Put<ClientResponse>(updateRequest);
Console.WriteLine("PUT Response: {0}\n", response);
var getClientRequest = new GetClientRequest
{
Id = response.Id,
Date = DateTime.Now.Date
};
response = client.Get<ClientResponse>(getClientRequest);
Console.WriteLine("GET Response: {0}\n", response);
var deleteRequest = new DeleteClientRequest
{
Id = response.Id
};
client.Delete(deleteRequest);
var certificate = new MemoryStream(File.ReadAllBytes("Certificate.cer"));
var uploadRequest = new UploadRequest
{
FileContents = certificate.ToArray(),
OriginalFileName = "MyFileName.cert",
UploaderId = Guid.NewGuid().ToString()
};
client.Post(uploadRequest);
Console.ReadKey();
}
示例7: Main
private static void Main()
{
var client = new JsonServiceClient("http://localhost:9090/requests");
var presentRequest = new PresentRequest
{
Id = Guid.NewGuid(),
Address = new Address
{
Country = "sheldonopolis",
},
Wish = "Could you please help developers to understand, " +
"WCF is awesome only with Nelibur"
};
client.Post(presentRequest);
var requestQuery = new PresentRequestQuery
{
Country = "sheldonopolis",
Status = PresentRequestStatus.Pending.ToString()
};
List<PresentRequest> pendingRequests = client.Get<List<PresentRequest>>(requestQuery);
Console.WriteLine("Pending present requests count: {0}", pendingRequests.Count);
var updatePresentRequestStatus = new UpdatePresentRequestStatus
{
Status = PresentRequestStatus.Accepted.ToString()
};
client.Post(updatePresentRequestStatus);
var deleteByStatus = new DeletePresentRequestsByStatus
{
Status = PresentRequestStatus.Accepted.ToString()
};
client.Delete(deleteByStatus);
Console.WriteLine("Press any key for Exit");
Console.ReadKey();
}
示例8: Main
private static void Main()
{
AppDomain.CurrentDomain.UnhandledException += UnhandledExceptionHandler;
// PerformanceTest();
var client = new JsonServiceClient(Settings.Default.ServiceAddress);
var createRequest = new CreateClientRequest
{
Email = "[email protected]"
};
var response = client.Post<ClientResponse>(createRequest);
Console.WriteLine("POST Response: {0}\n", response);
var updateRequest = new UpdateClientRequest
{
Email = "[email protected]",
Id = response.Id
};
response = client.Put<ClientResponse>(updateRequest);
Console.WriteLine("PUT Response: {0}\n", response);
var getClientRequest = new GetClientRequest
{
Id = response.Id,
Date = DateTime.Now.Date
};
response = client.Get<ClientResponse>(getClientRequest);
Console.WriteLine("GET Response: {0}\n", response);
var deleteRequest = new DeleteClientRequest
{
Id = response.Id
};
client.Delete(deleteRequest);
Console.ReadKey();
}
示例9: Can_view_create_and_delete_TODOs_over_REST
public void Can_view_create_and_delete_TODOs_over_REST()
{
var restClient = new JsonServiceClient("http://localhost:37022/");
var all = restClient.Get<List<Todo>>("/todos");
Assert.That(all.Count, Is.EqualTo(0));
var todo = restClient.Post<Todo>("/todos", new Todo { Content = "New TODO", Order = 1 });
Assert.That(todo.Id, Is.GreaterThan(0));
Assert.That(todo.Content, Is.EqualTo("New TODO"));
all = restClient.Get<List<Todo>>("/todos");
Assert.That(all.Count, Is.EqualTo(1));
todo.Content = "Updated TODO";
todo = restClient.Post<Todo>("/todos", todo);
Assert.That(todo.Content, Is.EqualTo("Updated TODO"));
restClient.Delete<Todo>("/todos/" + todo.Id);
all = restClient.Get<List<Todo>>("/todos");
Assert.That(all.Count, Is.EqualTo(0));
}
示例10: JsonServiceClient
//
public static void Удалить(СтатьиОборотовПоБюджетамЗапрос СтатьиОборотовПоБюджетамЗапрос)
{
var Урл = "http://localhost:1337/Справочники/СтатьиОборотовПоБюджетам?format=json";
var Клиент = new JsonServiceClient(Урл);
var СтатьиОборотовПоБюджетамОтвет = Клиент.Delete(СтатьиОборотовПоБюджетамЗапрос);
}
示例11: JsonServiceClient
//
public static void Удалить(СпецификацииНоменклатурыЗапрос СпецификацииНоменклатурыЗапрос)
{
var Урл = "http://localhost:1337/Справочники/СпецификацииНоменклатуры?format=json";
var Клиент = new JsonServiceClient(Урл);
var СпецификацииНоменклатурыОтвет = Клиент.Delete(СпецификацииНоменклатурыЗапрос);
}
示例12: JsonServiceClient
//
public static void Удалить(МедицинскиеСтраховыеПолисыЗапрос МедицинскиеСтраховыеПолисыЗапрос)
{
var Урл = "http://localhost:1337/Справочники/МедицинскиеСтраховыеПолисы?format=json";
var Клиент = new JsonServiceClient(Урл);
var МедицинскиеСтраховыеПолисыОтвет = Клиент.Delete(МедицинскиеСтраховыеПолисыЗапрос);
}
示例13: JsonServiceClient
//
public static void Удалить(ТерриториальныеУсловияЗапрос ТерриториальныеУсловияЗапрос)
{
var Урл = "http://localhost:1337/Справочники/ТерриториальныеУсловия?format=json";
var Клиент = new JsonServiceClient(Урл);
var ТерриториальныеУсловияОтвет = Клиент.Delete(ТерриториальныеУсловияЗапрос);
}
示例14: JsonServiceClient
//
public static void Удалить(ТСДФорматыДанныхЗапрос ТСДФорматыДанныхЗапрос)
{
var Урл = "http://localhost:1337/Справочники/ТСДФорматыДанных?format=json";
var Клиент = new JsonServiceClient(Урл);
var ТСДФорматыДанныхОтвет = Клиент.Delete(ТСДФорматыДанныхЗапрос);
}
示例15: JsonServiceClient
//
public static void Удалить(УсловияПродажЗапрос УсловияПродажЗапрос)
{
var Урл = "http://localhost:1337/Справочники/УсловияПродаж?format=json";
var Клиент = new JsonServiceClient(Урл);
var УсловияПродажОтвет = Клиент.Delete(УсловияПродажЗапрос);
}