{"action":"opened","issue":{"url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11515","repository_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore","labels_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11515/labels{/name}","comments_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11515/comments","events_url":"https://api.github.com/repos/aspnet/EntityFrameworkCore/issues/11515/events","html_url":"https://github.com/aspnet/EntityFrameworkCore/issues/11515","id":310337379,"number":11515,"title":"SqlException: The operation 'MERGE' is not supported with memory optimized tables.","user":{"login":"sepehr1014","id":11347847,"avatar_url":"https://avatars0.githubusercontent.com/u/11347847?v=4","gravatar_id":"","url":"https://api.github.com/users/sepehr1014","html_url":"https://github.com/sepehr1014","followers_url":"https://api.github.com/users/sepehr1014/followers","following_url":"https://api.github.com/users/sepehr1014/following{/other_user}","gists_url":"https://api.github.com/users/sepehr1014/gists{/gist_id}","starred_url":"https://api.github.com/users/sepehr1014/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sepehr1014/subscriptions","organizations_url":"https://api.github.com/users/sepehr1014/orgs","repos_url":"https://api.github.com/users/sepehr1014/repos","events_url":"https://api.github.com/users/sepehr1014/events{/privacy}","received_events_url":"https://api.github.com/users/sepehr1014/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-04-01T16:50:51Z","updated_at":"2018-04-01T16:50:51Z","closed_at":null,"author_association":"NONE","body":"Using the preview release, I get the following exception when adding multiple entities to a DbSet:\r\n\r\n```\r\nMicrosoft.EntityFrameworkCore.DbUpdateException: An error occurred while updating the entries. See the inner exception for details. ---> System.Data.SqlClient.SqlException: The operation 'MERGE' is not supported with memory optimized tables.\r\n   at System.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__121_0(Task`1 result)\r\n   at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()\r\n   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)\r\n   at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.RelationalCommand.<ExecuteAsync>d__17.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.<ExecuteAsync>d__32.MoveNext()\r\n   --- End of inner exception stack trace ---\r\n   at Microsoft.EntityFrameworkCore.Update.ReaderModificationCommandBatch.<ExecuteAsync>d__32.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Update.Internal.BatchExecutor.<ExecuteAsync>d__10.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.Storage.Internal.SqlServerExecutionStrategy.<ExecuteAsync>d__7`2.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<SaveChangesAsync>d__73.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.StateManager.<SaveChangesAsync>d__71.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()\r\n   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)\r\n   at Microsoft.EntityFrameworkCore.DbContext.<SaveChangesAsync>d__54.MoveNext()\r\n--- End of stack trace from previous location where exception was thrown ---\r\n...\r\n```\r\n\r\n### Steps to reproduce\r\nAdd entities in a loop and save changes:\r\n\r\n\r\n\r\n```c#\r\n                        foreach (...)\r\n                        {\r\n                            var eventMessage = new Message\r\n                            {\r\n                                ...\r\n                            };\r\n                            db.Messages.Add(eventMessage);\r\n                        }\r\n\r\n                        await db.SaveChangesAsync();\r\n                        transaction.Commit();\r\n```\r\n\r\n### Further technical details\r\nEF Core version: 2.1.0-preview1-final\r\nDatabase Provider: Microsoft.EntityFrameworkCore.SqlServer\r\nOperating system: Windows Server 2016\r\n**Using in-memory tables in SQL Server 2017**"}}
{"actor":{"display_login":"sepehr1014"}}