{"action":"closed","issue":{"url":"https://api.github.com/repos/mbdavid/LiteDB/issues/408","repository_url":"https://api.github.com/repos/mbdavid/LiteDB","labels_url":"https://api.github.com/repos/mbdavid/LiteDB/issues/408/labels{/name}","comments_url":"https://api.github.com/repos/mbdavid/LiteDB/issues/408/comments","events_url":"https://api.github.com/repos/mbdavid/LiteDB/issues/408/events","html_url":"https://github.com/mbdavid/LiteDB/issues/408","id":198280096,"number":408,"title":"v3.0.0 - beta3 - Question regarding the Fluent Mapper with Index","user":{"login":"Splamy","id":6502527,"avatar_url":"https://avatars.githubusercontent.com/u/6502527?v=3","gravatar_id":"","url":"https://api.github.com/users/Splamy","html_url":"https://github.com/Splamy","followers_url":"https://api.github.com/users/Splamy/followers","following_url":"https://api.github.com/users/Splamy/following{/other_user}","gists_url":"https://api.github.com/users/Splamy/gists{/gist_id}","starred_url":"https://api.github.com/users/Splamy/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/Splamy/subscriptions","organizations_url":"https://api.github.com/users/Splamy/orgs","repos_url":"https://api.github.com/users/Splamy/repos","events_url":"https://api.github.com/users/Splamy/events{/privacy}","received_events_url":"https://api.github.com/users/Splamy/received_events","type":"User","site_admin":false},"labels":[{"id":124400224,"url":"https://api.github.com/repos/mbdavid/LiteDB/labels/question","name":"question","color":"cc317c","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2017-01-01T20:15:28Z","updated_at":"2017-01-01T21:03:06Z","closed_at":"2017-01-01T21:03:06Z","body":"I'm quite new to LiteDB and this seems kinda strange to me.\r\n\r\nWhy does the Fluent Mapper throw a `ArgumentNullException` here:\r\n```\r\nBsonMapper.Global.Entity<TesBase>()\r\n\t.Id(x => x.Id)\r\n\t.Index(x => x.Value)\r\n\t.Index(x => x.Embed.Import) // <= Problematic line\r\n\t;\r\n```\r\n\r\nwhile this works perfectly:\r\n```\r\nvar audioLogEntries = db.GetCollection<TesBase>(\"base\");\r\naudioLogEntries.EnsureIndex(x => x.Embed.Import);\r\n```\r\n\r\nUsed classes:\r\n```\r\nclass TesBase\r\n{\r\n\tpublic int Id { get; set; }\r\n\tpublic string Value { get; set; }\r\n\r\n\tpublic TesEmbed Embed { get; set; } = new TesEmbed();\r\n}\r\n\r\nclass TesEmbed\r\n{\r\n\tpublic string Import { get; set; }\r\n}\r\n```"}}
{"actor":{"display_login":"Splamy"}}