当前位置: 首页>>代码示例>>C#>>正文


C# JsonServiceClient.Delete方法代码示例

本文整理汇总了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();
 }
开发者ID:bholmes,项目名称:XamarinEvolve2013Project,代码行数:7,代码来源:SSTests.cs

示例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.
                }
            }
        }
开发者ID:eteeselink,项目名称:sioux_tech_radar,代码行数:33,代码来源:UsersTest.cs

示例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");
		}
开发者ID:dgg,项目名称:Crowdsource-it.org,代码行数:9,代码来源:TranslationsController.cs

示例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();
        }
开发者ID:reverentgeek,项目名称:LudicrousDemo,代码行数:9,代码来源:Form1.cs

示例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);
 }
开发者ID:blake2002,项目名称:Nelibur,代码行数:14,代码来源:PerformanceTests.cs

示例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();
        }
开发者ID:Nelibur,项目名称:Nelibur,代码行数:48,代码来源:Program.cs

示例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();
        }
开发者ID:GSerjo,项目名称:CodeProject,代码行数:39,代码来源:Program.cs

示例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();
        }
开发者ID:KaterinaShumskaya,项目名称:Nelibur,代码行数:38,代码来源:Program.cs

示例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));
		}
开发者ID:Qasemt,项目名称:ServiceStack.Examples,代码行数:23,代码来源:TodoAppTests.cs

示例10: JsonServiceClient

 //
 public static void Удалить(СтатьиОборотовПоБюджетамЗапрос СтатьиОборотовПоБюджетамЗапрос)
 {
     var Урл = "http://localhost:1337/Справочники/СтатьиОборотовПоБюджетам?format=json";
     var Клиент = new JsonServiceClient(Урл);
     var СтатьиОборотовПоБюджетамОтвет = Клиент.Delete(СтатьиОборотовПоБюджетамЗапрос);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:7,代码来源:СтатьиОборотовПоБюджетам.cs

示例11: JsonServiceClient

 //
 public static void Удалить(СпецификацииНоменклатурыЗапрос СпецификацииНоменклатурыЗапрос)
 {
     var Урл = "http://localhost:1337/Справочники/СпецификацииНоменклатуры?format=json";
     var Клиент = new JsonServiceClient(Урл);
     var СпецификацииНоменклатурыОтвет = Клиент.Delete(СпецификацииНоменклатурыЗапрос);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:7,代码来源:СпецификацииНоменклатуры.cs

示例12: JsonServiceClient

 //
 public static void Удалить(МедицинскиеСтраховыеПолисыЗапрос МедицинскиеСтраховыеПолисыЗапрос)
 {
     var Урл = "http://localhost:1337/Справочники/МедицинскиеСтраховыеПолисы?format=json";
     var Клиент = new JsonServiceClient(Урл);
     var МедицинскиеСтраховыеПолисыОтвет = Клиент.Delete(МедицинскиеСтраховыеПолисыЗапрос);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:7,代码来源:МедицинскиеСтраховыеПолисы.cs

示例13: JsonServiceClient

 //
 public static void Удалить(ТерриториальныеУсловияЗапрос ТерриториальныеУсловияЗапрос)
 {
     var Урл = "http://localhost:1337/Справочники/ТерриториальныеУсловия?format=json";
     var Клиент = new JsonServiceClient(Урл);
     var ТерриториальныеУсловияОтвет = Клиент.Delete(ТерриториальныеУсловияЗапрос);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:7,代码来源:ТерриториальныеУсловия.cs

示例14: JsonServiceClient

 //
 public static void Удалить(ТСДФорматыДанныхЗапрос ТСДФорматыДанныхЗапрос)
 {
     var Урл = "http://localhost:1337/Справочники/ТСДФорматыДанных?format=json";
     var Клиент = new JsonServiceClient(Урл);
     var ТСДФорматыДанныхОтвет = Клиент.Delete(ТСДФорматыДанныхЗапрос);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:7,代码来源:ТСДФорматыДанных.cs

示例15: JsonServiceClient

 //
 public static void Удалить(УсловияПродажЗапрос УсловияПродажЗапрос)
 {
     var Урл = "http://localhost:1337/Справочники/УсловияПродаж?format=json";
     var Клиент = new JsonServiceClient(Урл);
     var УсловияПродажОтвет = Клиент.Delete(УсловияПродажЗапрос);
 }
开发者ID:Rugut,项目名称:UPP,代码行数:7,代码来源:УсловияПродаж.cs


注:本文中的JsonServiceClient.Delete方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。