{"action":"created","issue":{"url":"https://api.github.com/repos/alekseynemiro/MoneyBook/issues/14","labels_url":"https://api.github.com/repos/alekseynemiro/MoneyBook/issues/14/labels{/name}","comments_url":"https://api.github.com/repos/alekseynemiro/MoneyBook/issues/14/comments","events_url":"https://api.github.com/repos/alekseynemiro/MoneyBook/issues/14/events","html_url":"https://github.com/alekseynemiro/MoneyBook/issues/14","id":79475427,"number":14,"title":"Общий тип для классов БД","user":{"login":"alekseynemiro","id":6204692,"avatar_url":"https://avatars.githubusercontent.com/u/6204692?v=3","gravatar_id":"","url":"https://api.github.com/users/alekseynemiro","html_url":"https://github.com/alekseynemiro","followers_url":"https://api.github.com/users/alekseynemiro/followers","following_url":"https://api.github.com/users/alekseynemiro/following{/other_user}","gists_url":"https://api.github.com/users/alekseynemiro/gists{/gist_id}","starred_url":"https://api.github.com/users/alekseynemiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekseynemiro/subscriptions","organizations_url":"https://api.github.com/users/alekseynemiro/orgs","repos_url":"https://api.github.com/users/alekseynemiro/repos","events_url":"https://api.github.com/users/alekseynemiro/events{/privacy}","received_events_url":"https://api.github.com/users/alekseynemiro/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":{"url":"https://api.github.com/repos/alekseynemiro/MoneyBook/milestones/2","html_url":"https://github.com/alekseynemiro/MoneyBook/milestones/Core","labels_url":"https://api.github.com/repos/alekseynemiro/MoneyBook/milestones/2/labels","id":1118485,"number":2,"title":"Core","description":null,"creator":{"login":"alekseynemiro","id":6204692,"avatar_url":"https://avatars.githubusercontent.com/u/6204692?v=3","gravatar_id":"","url":"https://api.github.com/users/alekseynemiro","html_url":"https://github.com/alekseynemiro","followers_url":"https://api.github.com/users/alekseynemiro/followers","following_url":"https://api.github.com/users/alekseynemiro/following{/other_user}","gists_url":"https://api.github.com/users/alekseynemiro/gists{/gist_id}","starred_url":"https://api.github.com/users/alekseynemiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekseynemiro/subscriptions","organizations_url":"https://api.github.com/users/alekseynemiro/orgs","repos_url":"https://api.github.com/users/alekseynemiro/repos","events_url":"https://api.github.com/users/alekseynemiro/events{/privacy}","received_events_url":"https://api.github.com/users/alekseynemiro/received_events","type":"User","site_admin":false},"open_issues":4,"closed_issues":11,"state":"open","created_at":"2015-05-19T15:02:07Z","updated_at":"2015-05-24T17:04:54Z","due_on":null,"closed_at":null},"comments":7,"created_at":"2015-05-22T14:27:09Z","updated_at":"2015-05-25T08:28:59Z","closed_at":"2015-05-22T17:18:05Z","body":"Подумать о необходимости создания базового класса или интерфейса для проверки принадлежности типа к объектам базы данных.\r\n\r\nСуть проблемы видна в методах **Save** и **Delete** класса **User**:\r\n```C#\r\npublic void Save(object entity)\r\n{\r\n  // ...\r\n}\r\n\r\npublic void Save(List<object> entity)\r\n{\r\n  // ...\r\n}\r\n```\r\nОшибок нет, то тип `object` вполне может быть и `List<object>` и держать такой код не очень хорошо.\r\n\r\nЕсли сделать строгие типы, например: `EntityObject` и `List<EntityObject>`, то все будет более ли менее правильно. Но придется классам таблиц добавлять указатель на этот тип (наследоваться, или интерфейс определять)."},"comment":{"url":"https://api.github.com/repos/alekseynemiro/MoneyBook/issues/comments/105165483","html_url":"https://github.com/alekseynemiro/MoneyBook/issues/14#issuecomment-105165483","issue_url":"https://api.github.com/repos/alekseynemiro/MoneyBook/issues/14","id":105165483,"user":{"login":"alekseynemiro","id":6204692,"avatar_url":"https://avatars.githubusercontent.com/u/6204692?v=3","gravatar_id":"","url":"https://api.github.com/users/alekseynemiro","html_url":"https://github.com/alekseynemiro","followers_url":"https://api.github.com/users/alekseynemiro/followers","following_url":"https://api.github.com/users/alekseynemiro/following{/other_user}","gists_url":"https://api.github.com/users/alekseynemiro/gists{/gist_id}","starred_url":"https://api.github.com/users/alekseynemiro/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alekseynemiro/subscriptions","organizations_url":"https://api.github.com/users/alekseynemiro/orgs","repos_url":"https://api.github.com/users/alekseynemiro/repos","events_url":"https://api.github.com/users/alekseynemiro/events{/privacy}","received_events_url":"https://api.github.com/users/alekseynemiro/received_events","type":"User","site_admin":false},"created_at":"2015-05-25T08:28:59Z","updated_at":"2015-05-25T08:28:59Z","body":"Мне почему-то казалось, что тип нужно всегда явно указывать (в треугольных скобках). Такие конструкции могут показаться сложными, поэтому я на верхнем уровне старался избегать их использования. Как видно, зря. Плюс один опыту :-)"}}