{"action":"closed","issue":{"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11002","repository_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore","labels_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11002/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11002/comments","events_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11002/events","html_url":"https://github.com/aspnet/EntityFrameworkCore/issues/11002","id":297979558,"number":11002,"title":"Unable to 'Find' object by 'Guid'","user":{"login":"psla","id":161429,"avatar_url":"https://avatars0.githubusercontent.com/u/161429?v=4","gravatar_id":"","url":"https://api.github.com/users/psla","html_url":"https://github.com/psla","followers_url":"https://api.github.com/users/psla/followers","following_url":"https://api.github.com/users/psla/following{/other_user}","gists_url":"https://api.github.com/users/psla/gists{/gist_id}","starred_url":"https://api.github.com/users/psla/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/psla/subscriptions","organizations_url":"https://api.github.com/users/psla/orgs","repos_url":"https://api.github.com/users/psla/repos","events_url":"https://api.github.com/users/psla/events{/privacy}","received_events_url":"https://api.github.com/users/psla/received_events","type":"User","site_admin":false},"labels":[{"id":403965595,"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/labels/closed-question","name":"closed-question","color":"777777","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2018-02-17T04:58:50Z","updated_at":"2018-03-02T22:23:07Z","closed_at":"2018-03-02T22:23:07Z","author_association":"NONE","body":"When using SqlLite engine and an identity field of type Guid, one is unable to call .Find and get results. But if the results are in memory, they get returned correctly.\r\n\r\n```\r\nparsedKey\r\n{7805e947-bf99-45f3-9de6-c21338b51bf2}\r\n```\r\n\r\n## try calling .Find(parsedKey)\r\n```\r\n_context.ClientKeys.Find(parsedKey)\r\nMicrosoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\r\nPRAGMA foreign_keys=ON;\r\nApplication Insights Telemetry (unconfigured): {\"name\":\"Microsoft.ApplicationInsights.Dev.Message\",\"time\":\"2018-02-17T04:51:18.0720361Z\",\"tags\":{\"ai.operation.name\":\"POST /Admin/ClientKeys\",\"ai.internal.nodeName\":\"computername\",\"ai.internal.sdkVersion\":\"aspnet5c:2.1.1\",\"ai.cloud.roleInstance\":\"computername\",\"ai.location.ip\":\"127.0.0.1\",\"ai.operation.id\":\"66395371-4eaca902bfb153ba\",\"ai.application.ver\":\"1.0.0.0\",\"ai.operation.parentId\":\"|66395371-4eaca902bfb153ba.\"},\"data\":{\"baseType\":\"MessageData\",\"baseData\":{\"ver\":2,\"message\":\"Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\\r\\nPRAGMA foreign_keys=ON;\",\"severityLevel\":\"Information\",\"properties\":{\"AspNetCoreEnvironment\":\"Development\",\"commandTimeout\":\"30\",\"DeveloperMode\":\"true\",\"elapsed\":\"0\",\"commandText\":\"PRAGMA foreign_keys=ON;\",\"commandType\":\"Text\",\"CategoryName\":\"Microsoft.EntityFrameworkCore.Database.Command\",\"{OriginalFormat}\":\"Executed DbCommand ({elapsed}ms) [Parameters=[{parameters}], CommandType='{commandType}', Command\r\nTimeout='{commandTimeout}']{newLine}{commandText}\"}}}}\r\nMicrosoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (0ms) [Parameters=[@__get_Item_0='?'], CommandType='Text', CommandTimeout='30']\r\nSELECT \"e\".\"Id\"\r\nFROM \"ClientKeys\" AS \"e\"\r\nWHERE \"e\".\"Id\" = @__get_Item_0\r\nLIMIT 1\r\nApplication Insights Telemetry (unconfigured): {\"name\":\"Microsoft.ApplicationInsights.Dev.Message\",\"time\":\"2018-02-17T04:51:18.0756229Z\",\"tags\":{\"ai.operation.name\":\"POST /Admin/ClientKeys\",\"ai.internal.nodeName\":\"computername\",\"ai.internal.sdkVersion\":\"aspnet5c:2.1.1\",\"ai.cloud.roleInstance\":\"computername\",\"ai.location.ip\":\"127.0.0.1\",\"ai.operation.id\":\"66395371-4eaca902bfb153ba\",\"ai.application.ver\":\"1.0.0.0\",\"ai.operation.parentId\":\"|66395371-4eaca902bfb153ba.\"},\"data\":{\"baseType\":\"MessageData\",\"baseData\":{\"ver\":2,\"message\":\"Executed DbCommand (0ms) [Parameters=[@__get_Item_0='?'], CommandType='Text', CommandTimeout='30']\\r\\nSELECT \\\"e\\\".\\\"Id\\\"\\r\\nFROM \\\"ClientKeys\\\" AS \\\"e\\\"\\r\\nWHERE \\\"e\\\".\\\"Id\\\" = @__get_Item_0\\r\\nLIMIT 1\",\"severityLevel\":\"Information\",\"properties\":{\"parameters\":\"@__get_Item_0='?'\",\"AspNetCoreEnvironment\":\"Development\",\"commandTimeout\":\"30\",\"DeveloperMode\":\"true\",\"elapsed\":\"0\",\"commandText\":\"SELECT \\\"e\\\".\\\"Id\\\"\\r\\nFROM \\\"ClientKeys\\\" AS \\\"e\\\"\\r\\nWHERE \\\"e\\\".\\\"Id\\\" = @__get_Item_0\\r\\nLIMIT 1\r\n\",\"commandType\":\"Text\",\"CategoryName\":\"Microsoft.EntityFrameworkCore.Database.Command\",\"{OriginalFormat}\":\"Executed DbCommand ({elapsed}ms) [Parameters=[{parameters}], CommandType='{commandType}', CommandTimeout='{commandTimeout}']{newLine}{commandText}\"}}}}\r\nnull\r\n```\r\nThe result is null\r\n\r\n## Cache the collection by calling .ToList() on an DbSet in Context\r\n```\r\n_context.ClientKeys.ToList()\r\nMicrosoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\r\nPRAGMA foreign_keys=ON;\r\nApplication Insights Telemetry (unconfigured): {\"name\":\"Microsoft.ApplicationInsights.Dev.Message\",\"time\":\"2018-02-17T04:52:22.4274394Z\",\"tags\":{\"ai.operation.name\":\"POST /Admin/ClientKeys\",\"ai.internal.nodeName\":\"computername\",\"ai.internal.sdkVersion\":\"aspnet5c:2.1.1\",\"ai.cloud.roleInstance\":\"computername\",\"ai.location.ip\":\"127.0.0.1\",\"ai.operation.id\":\"66395371-4eaca902bfb153ba\",\"ai.application.ver\":\"1.0.0.0\",\"ai.operation.parentId\":\"|66395371-4eaca902bfb153ba.\"},\"data\":{\"baseType\":\"MessageData\",\"baseData\":{\"ver\":2,\"message\":\"Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\\r\\nPRAGMA foreign_keys=ON;\",\"severityLevel\":\"Information\",\"properties\":{\"AspNetCoreEnvironment\":\"Development\",\"commandTimeout\":\"30\",\"DeveloperMode\":\"true\",\"elapsed\":\"0\",\"commandText\":\"PRAGMA foreign_keys=ON;\",\"commandType\":\"Text\",\"CategoryName\":\"Microsoft.EntityFrameworkCore.Database.Command\",\"{OriginalFormat}\":\"Executed DbCommand ({elapsed}ms) [Parameters=[{parameters}], CommandType='{commandType}', Command\r\nTimeout='{commandTimeout}']{newLine}{commandText}\"}}}}\r\nMicrosoft.EntityFrameworkCore.Database.Command:Information: Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\r\nSELECT \"c\".\"Id\"\r\nFROM \"ClientKeys\" AS \"c\"\r\nApplication Insights Telemetry (unconfigured): {\"name\":\"Microsoft.ApplicationInsights.Dev.Message\",\"time\":\"2018-02-17T04:52:22.4313100Z\",\"tags\":{\"ai.operation.name\":\"POST /Admin/ClientKeys\",\"ai.internal.nodeName\":\"computername\",\"ai.internal.sdkVersion\":\"aspnet5c:2.1.1\",\"ai.cloud.roleInstance\":\"computername\",\"ai.location.ip\":\"127.0.0.1\",\"ai.operation.id\":\"66395371-4eaca902bfb153ba\",\"ai.application.ver\":\"1.0.0.0\",\"ai.operation.parentId\":\"|66395371-4eaca902bfb153ba.\"},\"data\":{\"baseType\":\"MessageData\",\"baseData\":{\"ver\":2,\"message\":\"Executed DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']\\r\\nSELECT \\\"c\\\".\\\"Id\\\"\\r\\nFROM \\\"ClientKeys\\\" AS \\\"c\\\"\",\"severityLevel\":\"Information\",\"properties\":{\"AspNetCoreEnvironment\":\"Development\",\"commandTimeout\":\"30\",\"DeveloperMode\":\"true\",\"elapsed\":\"0\",\"commandText\":\"SELECT \\\"c\\\".\\\"Id\\\"\\r\\nFROM \\\"ClientKeys\\\" AS \\\"c\\\"\",\"commandType\":\"Text\",\"CategoryName\":\"Microsoft.EntityFrameworkCore.Database.Command\",\"{OriginalFormat}\":\"Executed DbCommand ({elapsed}ms) [Paramet\r\ners=[{parameters}], CommandType='{commandType}', CommandTimeout='{commandTimeout}']{newLine}{commandText}\"}}}}\r\nCount = 1\r\n    [0]: {Models.ClientKey}\r\n```\r\nyou can see one element is now in the collection\r\n\r\n## Repeat the .Find operation\r\n```\r\n_context.ClientKeys.Find(parsedKey)\r\n{Models.ClientKey}\r\n    Id: {7805e947-bf99-45f3-9de6-c21338b51bf2}\r\n```\r\nnow you can see the element is returned\r\n\r\nMy db context: ```public DbSet<ClientKey> ClientKeys { get; set; }```, my ClientKey: \r\n```\r\n public class ClientKey\r\n    {\r\n        [Key]\r\n        public Guid Id { get; set; }\r\n    }\r\n```"}}
{"actor":{"display_login":"bricelam"}}