{"action":"created","issue":{"url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695","repository_url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL","labels_url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695/labels{/name}","comments_url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695/comments","events_url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695/events","html_url":"https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695","id":379912005,"node_id":"MDU6SXNzdWUzNzk5MTIwMDU=","number":695,"title":"Translate .OrderBy(_ => Guid.NewGuid())","user":{"login":"eshangin","id":3841340,"node_id":"MDQ6VXNlcjM4NDEzNDA=","avatar_url":"https://avatars3.githubusercontent.com/u/3841340?v=4","gravatar_id":"","url":"https://api.github.com/users/eshangin","html_url":"https://github.com/eshangin","followers_url":"https://api.github.com/users/eshangin/followers","following_url":"https://api.github.com/users/eshangin/following{/other_user}","gists_url":"https://api.github.com/users/eshangin/gists{/gist_id}","starred_url":"https://api.github.com/users/eshangin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eshangin/subscriptions","organizations_url":"https://api.github.com/users/eshangin/orgs","repos_url":"https://api.github.com/users/eshangin/repos","events_url":"https://api.github.com/users/eshangin/events{/privacy}","received_events_url":"https://api.github.com/users/eshangin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-11-12T19:05:10Z","updated_at":"2018-11-13T06:55:34Z","closed_at":null,"author_association":"NONE","body":"Hi. Today tried to apply .OrderBy(item => Guid.NewGuid()) to get items in random order but as I see Npgsql unable to translate it to Postgres query. In case of MsSQL it works and translates to \"order by newid()\" query.\r\nI think it will be good to have the same kind feature in Npgsql. Maybe it could be in EF.Functions, I'm not sure..."},"comment":{"url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/comments/438157725","html_url":"https://github.com/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695#issuecomment-438157725","issue_url":"https://api.github.com/repos/npgsql/Npgsql.EntityFrameworkCore.PostgreSQL/issues/695","id":438157725,"node_id":"MDEyOklzc3VlQ29tbWVudDQzODE1NzcyNQ==","user":{"login":"YohDeadfall","id":10694013,"node_id":"MDQ6VXNlcjEwNjk0MDEz","avatar_url":"https://avatars0.githubusercontent.com/u/10694013?v=4","gravatar_id":"","url":"https://api.github.com/users/YohDeadfall","html_url":"https://github.com/YohDeadfall","followers_url":"https://api.github.com/users/YohDeadfall/followers","following_url":"https://api.github.com/users/YohDeadfall/following{/other_user}","gists_url":"https://api.github.com/users/YohDeadfall/gists{/gist_id}","starred_url":"https://api.github.com/users/YohDeadfall/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/YohDeadfall/subscriptions","organizations_url":"https://api.github.com/users/YohDeadfall/orgs","repos_url":"https://api.github.com/users/YohDeadfall/repos","events_url":"https://api.github.com/users/YohDeadfall/events{/privacy}","received_events_url":"https://api.github.com/users/YohDeadfall/received_events","type":"User","site_admin":false},"created_at":"2018-11-13T06:55:34Z","updated_at":"2018-11-13T06:55:34Z","author_association":"MEMBER","body":"The problem here is in the `uuid` type which doesn't have random generators out of the box. Therefore, the user should use one of two extensions. We can't dictate which one must be used. It's a [documented limitation](http://www.npgsql.org/efcore/value-generation.html#guiduuid-generation).\r\n\r\nTo workaround the issue create an extension you want and a database function. For example:\r\n\r\n```csharp\r\n// Requires pgcrypto\r\n[DbFunction]\r\npublic static Guid GenRandomUuid() => throw new NotImplementedException();\r\n```\r\n"}}
{"actor":{"display_login":"YohDeadfall"}}