{"action":"opened","issue":{"url":"https://api.github.com/repos/borisdj/EFCore.BulkExtensions/issues/103","repository_url":"https://api.github.com/repos/borisdj/EFCore.BulkExtensions","labels_url":"https://api.github.com/repos/borisdj/EFCore.BulkExtensions/issues/103/labels{/name}","comments_url":"https://api.github.com/repos/borisdj/EFCore.BulkExtensions/issues/103/comments","events_url":"https://api.github.com/repos/borisdj/EFCore.BulkExtensions/issues/103/events","html_url":"https://github.com/borisdj/EFCore.BulkExtensions/issues/103","id":384375281,"node_id":"MDU6SXNzdWUzODQzNzUyODE=","number":103,"title":"BatchUpdate fail: NullReferenceException","user":{"login":"leehom0123","id":10956708,"node_id":"MDQ6VXNlcjEwOTU2NzA4","avatar_url":"https://avatars2.githubusercontent.com/u/10956708?v=4","gravatar_id":"","url":"https://api.github.com/users/leehom0123","html_url":"https://github.com/leehom0123","followers_url":"https://api.github.com/users/leehom0123/followers","following_url":"https://api.github.com/users/leehom0123/following{/other_user}","gists_url":"https://api.github.com/users/leehom0123/gists{/gist_id}","starred_url":"https://api.github.com/users/leehom0123/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/leehom0123/subscriptions","organizations_url":"https://api.github.com/users/leehom0123/orgs","repos_url":"https://api.github.com/users/leehom0123/repos","events_url":"https://api.github.com/users/leehom0123/events{/privacy}","received_events_url":"https://api.github.com/users/leehom0123/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-11-26T15:14:12Z","updated_at":"2018-11-26T15:14:12Z","closed_at":null,"author_association":"CONTRIBUTOR","body":"My code like this:\r\n\r\n````\r\n    public enum FeeStatus\r\n    {\r\n        NotCloseAccount,\r\n        LuNotEstablish,\r\n        NotTransfer,\r\n        Transfered\r\n    }\r\n```\r\n\r\n\r\n```Fee.cs\r\n    public partial class Fee \r\n    {\r\n.....\r\n        public virtual FeeStatus Status { get; set; }\r\n\r\n        public virtual Guid? CloseAccountId { get; set; } // CloseAccountId \r\n\r\n.....\r\n\r\n    }\r\n```\r\n\r\nAnd when I use BatchUpdateAsync:\r\n\r\n```\r\nawait context.Fees.Where(x =>\r\n    x.BusinessDate >= ca.StartDate\r\n    && x.BusinessDate <= ca.EndDate\r\n    )\r\n    .BatchUpdateAsync(new Fee\r\n    {\r\n        CloseAccountId = ca.Id,\r\n        Status = FeeStatus.LuNotEstablish\r\n    },\r\n    new List<string> {\r\n        nameof(Fee.CloseAccountId),\r\n        nameof(Fee.Status)\r\n    });\r\n```\r\nThere is NullReferenceException:\r\n```\r\nSystem.NullReferenceException: Object reference not set to an instance of an object.\r\n   at EFCore.BulkExtensions.BatchUtil.GetSqlSetSegment[T](DbContext context, T updateValues, List`1 updateColumns)\r\n   at EFCore.BulkExtensions.BatchUtil.GetSqlUpdate[T](IQueryable`1 query, DbContext context, T updateValues, List`1 updateColumns)\r\n   at EFCore.BulkExtensions.IQueryableBatchExtensions.BatchUpdateAsync[T](IQueryable`1 query, T updateValues, List`1 updateColumns)\r\n   at Bit.Lu.Fp.CloseAccountAppService.CalcTransfer(EntityDto`1 input) in D:\\Repos\\aspnet-core\\src\\Bit.Lu.Application\\Lu\\Fp\\CloseAccounts\\CloseAccountAppService.cs:line 307\r\n ```"}}
{"actor":{"display_login":"leehom0123"}}