{"action":"created","issue":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1264","repository_url":"https://api.github.com/repos/volkanceylan/Serenity","labels_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1264/labels{/name}","comments_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1264/comments","events_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1264/events","html_url":"https://github.com/volkanceylan/Serenity/issues/1264","id":180595597,"number":1264,"title":"Connection vs Repository","user":{"login":"Estrusco","id":16304015,"avatar_url":"https://avatars.githubusercontent.com/u/16304015?v=3","gravatar_id":"","url":"https://api.github.com/users/Estrusco","html_url":"https://github.com/Estrusco","followers_url":"https://api.github.com/users/Estrusco/followers","following_url":"https://api.github.com/users/Estrusco/following{/other_user}","gists_url":"https://api.github.com/users/Estrusco/gists{/gist_id}","starred_url":"https://api.github.com/users/Estrusco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Estrusco/subscriptions","organizations_url":"https://api.github.com/users/Estrusco/orgs","repos_url":"https://api.github.com/users/Estrusco/repos","events_url":"https://api.github.com/users/Estrusco/events{/privacy}","received_events_url":"https://api.github.com/users/Estrusco/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-10-03T09:21:02Z","updated_at":"2016-10-03T09:26:15Z","closed_at":null,"body":"Two questions, please.\r\n\r\nFrom the business logic in other classes is more convenient use Connection.Insert-GetBy-List ecc or call new MyRepo().Create-Retrieve-List ecc.? Is there any difference?\r\nAnd there is a way to use Connection.List with **ColumnSelection.Details**?\r\n\r\n```cs\r\nvar list = Connection.List<xyz1Row>(field == new ValueCriteria(value));\r\nlong? id = Connection.InsertAndGetID<other2Row>(newRow);\r\n```\r\nor \r\n\r\n```cs\r\nvar list = new MyRepo1().List(Connection, new Serenity.Services.ListRequest() { ... }).Entities.ToList();\r\n\r\nUnitOfWork uow = new UnitOfWork(connection);\r\nSaveRequest<MyRow> sr = new SaveRequest<MyRow>();\r\nsr.Entity = newRow;\r\nnew MyRepo2().Create(uow, sr);\r\n```\r\n\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/volkanceylan/Serenity/issues/comments/251062993","html_url":"https://github.com/volkanceylan/Serenity/issues/1264#issuecomment-251062993","issue_url":"https://api.github.com/repos/volkanceylan/Serenity/issues/1264","id":251062993,"user":{"login":"volkanceylan","id":752470,"avatar_url":"https://avatars.githubusercontent.com/u/752470?v=3","gravatar_id":"","url":"https://api.github.com/users/volkanceylan","html_url":"https://github.com/volkanceylan","followers_url":"https://api.github.com/users/volkanceylan/followers","following_url":"https://api.github.com/users/volkanceylan/following{/other_user}","gists_url":"https://api.github.com/users/volkanceylan/gists{/gist_id}","starred_url":"https://api.github.com/users/volkanceylan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/volkanceylan/subscriptions","organizations_url":"https://api.github.com/users/volkanceylan/orgs","repos_url":"https://api.github.com/users/volkanceylan/repos","events_url":"https://api.github.com/users/volkanceylan/events{/privacy}","received_events_url":"https://api.github.com/users/volkanceylan/received_events","type":"User","site_admin":false},"created_at":"2016-10-03T09:26:15Z","updated_at":"2016-10-03T09:26:15Z","body":"Connection extensions access DB directly, without going through repositories / behaviors. If you dont need or care about behaviors / validation / permissions / business logic etc, it is fine to use them and they are faster. Details mode only meaningful for List handlers so connection.List doesnt have such a feature. You may modify query by using its second overload and select fields you like. You may write an extension method similar to SelectTableFields if you need all detail fields often."}}
{"actor":{"display_login":"volkanceylan"}}