{"action":"created","comment":{"url":"https://api.github.com/repos/Jake33rus/WCF/pulls/comments/186532182","pull_request_review_id":118121217,"id":186532182,"diff_hunk":"@@ -0,0 +1,96 @@\n+﻿using System;\r\n+using System.Collections.Generic;\r\n+using System.Linq;\r\n+using System.Linq.Expressions;\r\n+using System.Reflection;\r\n+using System.Runtime.Serialization;\r\n+using System.ServiceModel;\r\n+using System.Text;\r\n+using CommonLib.Models;\r\n+using CommonLib.Repositories;\r\n+\r\n+namespace MyService\r\n+{\r\n+    // ПРИМЕЧАНИЕ. Команду \"Переименовать\" в меню \"Рефакторинг\" можно использовать для одновременного изменения имени класса \"Service1\" в коде и файле конфигурации.\r\n+    public class Service : IService\r\n+    {\r\n+        ImmoRepos ir = new ImmoRepos();\r\n+        \r\n+        Immovables immoEdit;\r\n+        ServiceOperationResult operationResult = new ServiceOperationResult();\r\n+        public Immovables CancelEdit()\r\n+        {\r\n+             var tempIr = new ImmoRepos();\r\n+             var d = tempIr.db.Immovables.FirstOrDefault(x => x.Id == immoEdit.Id);\r\n+             PropertyInfo[] myPropertyInfo = immoEdit.GetType().GetProperties();\r\n+             PropertyInfo[] oldPropertyInfo = d.GetType().GetProperties();\r\n+             foreach (PropertyInfo myProp in myPropertyInfo)\r\n+             {\r\n+                 string propName = myProp.Name;\r\n+                 foreach (PropertyInfo oldProp in oldPropertyInfo)\r\n+                 {\r\n+                     string oldpropName = oldProp.Name;\r\n+                     if (propName == oldpropName)\r\n+                     {\r\n+                         myProp.SetValue(immoEdit, oldProp.GetValue(d));\r\n+                     }\r\n+                 }\r\n+             }\r\n+            return immoEdit;\r\n+        }\r\n+\r\n+        public ServiceOperationResult DBSave()\r\n+        {\r\n+            try\r\n+            {\r\n+                ir.Update(immoEdit.Id, immoEdit);\r\n+            }\r\n+            catch (Exception e)\r\n+            {\r\n+                operationResult.Message = e.Message;\r\n+                operationResult.IsSuccess = true;\r\n+            }\r\n+            return operationResult;\r\n+        }\r\n+\r\n+        public List<ImmoInfo> GetImmo()\r\n+        {\r\n+            var list = new List<ImmoInfo>();\r\n+            foreach(var immo in ir.Load())\r\n+            {\r\n+                list.Add(new ImmoInfo(immo.Id, immo.Name));\r\n+            }\r\n+            return list;\r\n+        }\r\n+\r\n+        public Immovables SetImmovablesFieldValue(string fieldName, object val)\r\n+        {\r\n+            PropertyInfo[] myPropertyInfo = immoEdit.GetType().GetProperties();\r\n+            var prop = myPropertyInfo.FirstOrDefault(myProp => myProp.Name == fieldName);\r\n+            var t = prop.PropertyType;\r\n+            if (t.IsGenericType && t.GetGenericTypeDefinition().Equals(typeof(Nullable<>)))\r\n+            {\r\n+                if (val == null)\r\n+                {\r\n+                    return null;\r","path":"MyService/MyService/Service.cs","position":75,"original_position":75,"commit_id":"7b977aacbbc05827a9555d2795e9f7ab93e6a481","original_commit_id":"7b977aacbbc05827a9555d2795e9f7ab93e6a481","user":{"login":"troepolik","id":11777855,"avatar_url":"https://avatars2.githubusercontent.com/u/11777855?v=4","gravatar_id":"","url":"https://api.github.com/users/troepolik","html_url":"https://github.com/troepolik","followers_url":"https://api.github.com/users/troepolik/followers","following_url":"https://api.github.com/users/troepolik/following{/other_user}","gists_url":"https://api.github.com/users/troepolik/gists{/gist_id}","starred_url":"https://api.github.com/users/troepolik/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/troepolik/subscriptions","organizations_url":"https://api.github.com/users/troepolik/orgs","repos_url":"https://api.github.com/users/troepolik/repos","events_url":"https://api.github.com/users/troepolik/events{/privacy}","received_events_url":"https://api.github.com/users/troepolik/received_events","type":"User","site_admin":false},"body":"return null;\r\nкакой-то странный возврат...","created_at":"2018-05-07T20:00:32Z","updated_at":"2018-05-07T20:06:44Z","html_url":"https://github.com/Jake33rus/WCF/pull/4#discussion_r186532182","pull_request_url":"https://api.github.com/repos/Jake33rus/WCF/pulls/4","author_association":"COLLABORATOR","_links":{"self":{"href":"https://api.github.com/repos/Jake33rus/WCF/pulls/comments/186532182"},"html":{"href":"https://github.com/Jake33rus/WCF/pull/4#discussion_r186532182"},"pull_request":{"href":"https://api.github.com/repos/Jake33rus/WCF/pulls/4"}}},"pull_request":{"url":"https://api.github.com/repos/Jake33rus/WCF/pulls/4","id":186218489,"html_url":"https://github.com/Jake33rus/WCF/pull/4","diff_url":"https://github.com/Jake33rus/WCF/pull/4.diff","patch_url":"https://github.com/Jake33rus/WCF/pull/4.patch","issue_url":"https://api.github.com/repos/Jake33rus/WCF/issues/4","number":4,"state":"open","locked":false,"title":"Thin Client WCF","user":{"login":"Jake33rus","id":17555867,"avatar_url":"https://avatars1.githubusercontent.com/u/17555867?v=4","gravatar_id":"","url":"https://api.github.com/users/Jake33rus","html_url":"https://github.com/Jake33rus","followers_url":"https://api.github.com/users/Jake33rus/followers","following_url":"https://api.github.com/users/Jake33rus/following{/other_user}","gists_url":"https://api.github.com/users/Jake33rus/gists{/gist_id}","starred_url":"https://api.github.com/users/Jake33rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jake33rus/subscriptions","organizations_url":"https://api.github.com/users/Jake33rus/orgs","repos_url":"https://api.github.com/users/Jake33rus/repos","events_url":"https://api.github.com/users/Jake33rus/events{/privacy}","received_events_url":"https://api.github.com/users/Jake33rus/received_events","type":"User","site_admin":false},"body":"","created_at":"2018-05-06T18:11:46Z","updated_at":"2018-05-07T20:06:44Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bfa5071c8006152c13397dd62340cee3a597e2a4","assignee":null,"assignees":[],"requested_reviewers":[],"requested_teams":[],"labels":[],"milestone":null,"commits_url":"https://api.github.com/repos/Jake33rus/WCF/pulls/4/commits","review_comments_url":"https://api.github.com/repos/Jake33rus/WCF/pulls/4/comments","review_comment_url":"https://api.github.com/repos/Jake33rus/WCF/pulls/comments{/number}","comments_url":"https://api.github.com/repos/Jake33rus/WCF/issues/4/comments","statuses_url":"https://api.github.com/repos/Jake33rus/WCF/statuses/7b977aacbbc05827a9555d2795e9f7ab93e6a481","head":{"label":"Jake33rus:WCFThinClient","ref":"WCFThinClient","sha":"7b977aacbbc05827a9555d2795e9f7ab93e6a481","user":{"login":"Jake33rus","id":17555867,"avatar_url":"https://avatars1.githubusercontent.com/u/17555867?v=4","gravatar_id":"","url":"https://api.github.com/users/Jake33rus","html_url":"https://github.com/Jake33rus","followers_url":"https://api.github.com/users/Jake33rus/followers","following_url":"https://api.github.com/users/Jake33rus/following{/other_user}","gists_url":"https://api.github.com/users/Jake33rus/gists{/gist_id}","starred_url":"https://api.github.com/users/Jake33rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jake33rus/subscriptions","organizations_url":"https://api.github.com/users/Jake33rus/orgs","repos_url":"https://api.github.com/users/Jake33rus/repos","events_url":"https://api.github.com/users/Jake33rus/events{/privacy}","received_events_url":"https://api.github.com/users/Jake33rus/received_events","type":"User","site_admin":false},"repo":{"id":129754969,"name":"WCF","full_name":"Jake33rus/WCF","owner":{"login":"Jake33rus","id":17555867,"avatar_url":"https://avatars1.githubusercontent.com/u/17555867?v=4","gravatar_id":"","url":"https://api.github.com/users/Jake33rus","html_url":"https://github.com/Jake33rus","followers_url":"https://api.github.com/users/Jake33rus/followers","following_url":"https://api.github.com/users/Jake33rus/following{/other_user}","gists_url":"https://api.github.com/users/Jake33rus/gists{/gist_id}","starred_url":"https://api.github.com/users/Jake33rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jake33rus/subscriptions","organizations_url":"https://api.github.com/users/Jake33rus/orgs","repos_url":"https://api.github.com/users/Jake33rus/repos","events_url":"https://api.github.com/users/Jake33rus/events{/privacy}","received_events_url":"https://api.github.com/users/Jake33rus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jake33rus/WCF","description":null,"fork":false,"url":"https://api.github.com/repos/Jake33rus/WCF","forks_url":"https://api.github.com/repos/Jake33rus/WCF/forks","keys_url":"https://api.github.com/repos/Jake33rus/WCF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jake33rus/WCF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jake33rus/WCF/teams","hooks_url":"https://api.github.com/repos/Jake33rus/WCF/hooks","issue_events_url":"https://api.github.com/repos/Jake33rus/WCF/issues/events{/number}","events_url":"https://api.github.com/repos/Jake33rus/WCF/events","assignees_url":"https://api.github.com/repos/Jake33rus/WCF/assignees{/user}","branches_url":"https://api.github.com/repos/Jake33rus/WCF/branches{/branch}","tags_url":"https://api.github.com/repos/Jake33rus/WCF/tags","blobs_url":"https://api.github.com/repos/Jake33rus/WCF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jake33rus/WCF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jake33rus/WCF/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jake33rus/WCF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jake33rus/WCF/statuses/{sha}","languages_url":"https://api.github.com/repos/Jake33rus/WCF/languages","stargazers_url":"https://api.github.com/repos/Jake33rus/WCF/stargazers","contributors_url":"https://api.github.com/repos/Jake33rus/WCF/contributors","subscribers_url":"https://api.github.com/repos/Jake33rus/WCF/subscribers","subscription_url":"https://api.github.com/repos/Jake33rus/WCF/subscription","commits_url":"https://api.github.com/repos/Jake33rus/WCF/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jake33rus/WCF/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jake33rus/WCF/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jake33rus/WCF/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jake33rus/WCF/contents/{+path}","compare_url":"https://api.github.com/repos/Jake33rus/WCF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jake33rus/WCF/merges","archive_url":"https://api.github.com/repos/Jake33rus/WCF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jake33rus/WCF/downloads","issues_url":"https://api.github.com/repos/Jake33rus/WCF/issues{/number}","pulls_url":"https://api.github.com/repos/Jake33rus/WCF/pulls{/number}","milestones_url":"https://api.github.com/repos/Jake33rus/WCF/milestones{/number}","notifications_url":"https://api.github.com/repos/Jake33rus/WCF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jake33rus/WCF/labels{/name}","releases_url":"https://api.github.com/repos/Jake33rus/WCF/releases{/id}","deployments_url":"https://api.github.com/repos/Jake33rus/WCF/deployments","created_at":"2018-04-16T14:19:51Z","updated_at":"2018-04-24T18:31:20Z","pushed_at":"2018-05-06T18:11:47Z","git_url":"git://github.com/Jake33rus/WCF.git","ssh_url":"git@github.com:Jake33rus/WCF.git","clone_url":"https://github.com/Jake33rus/WCF.git","svn_url":"https://github.com/Jake33rus/WCF","homepage":null,"size":99,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"Jake33rus:master","ref":"master","sha":"d2982ad726e1e24f986661b21815f32fcaa74fb6","user":{"login":"Jake33rus","id":17555867,"avatar_url":"https://avatars1.githubusercontent.com/u/17555867?v=4","gravatar_id":"","url":"https://api.github.com/users/Jake33rus","html_url":"https://github.com/Jake33rus","followers_url":"https://api.github.com/users/Jake33rus/followers","following_url":"https://api.github.com/users/Jake33rus/following{/other_user}","gists_url":"https://api.github.com/users/Jake33rus/gists{/gist_id}","starred_url":"https://api.github.com/users/Jake33rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jake33rus/subscriptions","organizations_url":"https://api.github.com/users/Jake33rus/orgs","repos_url":"https://api.github.com/users/Jake33rus/repos","events_url":"https://api.github.com/users/Jake33rus/events{/privacy}","received_events_url":"https://api.github.com/users/Jake33rus/received_events","type":"User","site_admin":false},"repo":{"id":129754969,"name":"WCF","full_name":"Jake33rus/WCF","owner":{"login":"Jake33rus","id":17555867,"avatar_url":"https://avatars1.githubusercontent.com/u/17555867?v=4","gravatar_id":"","url":"https://api.github.com/users/Jake33rus","html_url":"https://github.com/Jake33rus","followers_url":"https://api.github.com/users/Jake33rus/followers","following_url":"https://api.github.com/users/Jake33rus/following{/other_user}","gists_url":"https://api.github.com/users/Jake33rus/gists{/gist_id}","starred_url":"https://api.github.com/users/Jake33rus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Jake33rus/subscriptions","organizations_url":"https://api.github.com/users/Jake33rus/orgs","repos_url":"https://api.github.com/users/Jake33rus/repos","events_url":"https://api.github.com/users/Jake33rus/events{/privacy}","received_events_url":"https://api.github.com/users/Jake33rus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/Jake33rus/WCF","description":null,"fork":false,"url":"https://api.github.com/repos/Jake33rus/WCF","forks_url":"https://api.github.com/repos/Jake33rus/WCF/forks","keys_url":"https://api.github.com/repos/Jake33rus/WCF/keys{/key_id}","collaborators_url":"https://api.github.com/repos/Jake33rus/WCF/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/Jake33rus/WCF/teams","hooks_url":"https://api.github.com/repos/Jake33rus/WCF/hooks","issue_events_url":"https://api.github.com/repos/Jake33rus/WCF/issues/events{/number}","events_url":"https://api.github.com/repos/Jake33rus/WCF/events","assignees_url":"https://api.github.com/repos/Jake33rus/WCF/assignees{/user}","branches_url":"https://api.github.com/repos/Jake33rus/WCF/branches{/branch}","tags_url":"https://api.github.com/repos/Jake33rus/WCF/tags","blobs_url":"https://api.github.com/repos/Jake33rus/WCF/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/Jake33rus/WCF/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/Jake33rus/WCF/git/refs{/sha}","trees_url":"https://api.github.com/repos/Jake33rus/WCF/git/trees{/sha}","statuses_url":"https://api.github.com/repos/Jake33rus/WCF/statuses/{sha}","languages_url":"https://api.github.com/repos/Jake33rus/WCF/languages","stargazers_url":"https://api.github.com/repos/Jake33rus/WCF/stargazers","contributors_url":"https://api.github.com/repos/Jake33rus/WCF/contributors","subscribers_url":"https://api.github.com/repos/Jake33rus/WCF/subscribers","subscription_url":"https://api.github.com/repos/Jake33rus/WCF/subscription","commits_url":"https://api.github.com/repos/Jake33rus/WCF/commits{/sha}","git_commits_url":"https://api.github.com/repos/Jake33rus/WCF/git/commits{/sha}","comments_url":"https://api.github.com/repos/Jake33rus/WCF/comments{/number}","issue_comment_url":"https://api.github.com/repos/Jake33rus/WCF/issues/comments{/number}","contents_url":"https://api.github.com/repos/Jake33rus/WCF/contents/{+path}","compare_url":"https://api.github.com/repos/Jake33rus/WCF/compare/{base}...{head}","merges_url":"https://api.github.com/repos/Jake33rus/WCF/merges","archive_url":"https://api.github.com/repos/Jake33rus/WCF/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/Jake33rus/WCF/downloads","issues_url":"https://api.github.com/repos/Jake33rus/WCF/issues{/number}","pulls_url":"https://api.github.com/repos/Jake33rus/WCF/pulls{/number}","milestones_url":"https://api.github.com/repos/Jake33rus/WCF/milestones{/number}","notifications_url":"https://api.github.com/repos/Jake33rus/WCF/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/Jake33rus/WCF/labels{/name}","releases_url":"https://api.github.com/repos/Jake33rus/WCF/releases{/id}","deployments_url":"https://api.github.com/repos/Jake33rus/WCF/deployments","created_at":"2018-04-16T14:19:51Z","updated_at":"2018-04-24T18:31:20Z","pushed_at":"2018-05-06T18:11:47Z","git_url":"git://github.com/Jake33rus/WCF.git","ssh_url":"git@github.com:Jake33rus/WCF.git","clone_url":"https://github.com/Jake33rus/WCF.git","svn_url":"https://github.com/Jake33rus/WCF","homepage":null,"size":99,"stargazers_count":0,"watchers_count":0,"language":"C#","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"archived":false,"open_issues_count":1,"license":null,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/Jake33rus/WCF/pulls/4"},"html":{"href":"https://github.com/Jake33rus/WCF/pull/4"},"issue":{"href":"https://api.github.com/repos/Jake33rus/WCF/issues/4"},"comments":{"href":"https://api.github.com/repos/Jake33rus/WCF/issues/4/comments"},"review_comments":{"href":"https://api.github.com/repos/Jake33rus/WCF/pulls/4/comments"},"review_comment":{"href":"https://api.github.com/repos/Jake33rus/WCF/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/Jake33rus/WCF/pulls/4/commits"},"statuses":{"href":"https://api.github.com/repos/Jake33rus/WCF/statuses/7b977aacbbc05827a9555d2795e9f7ab93e6a481"}},"author_association":"OWNER"}}
{"actor":{"display_login":"troepolik"}}