{"action":"closed","issue":{"url":"https://api.github.com/repos/jagregory/fluent-nhibernate/issues/329","labels_url":"https://api.github.com/repos/jagregory/fluent-nhibernate/issues/329/labels{/name}","comments_url":"https://api.github.com/repos/jagregory/fluent-nhibernate/issues/329/comments","events_url":"https://api.github.com/repos/jagregory/fluent-nhibernate/issues/329/events","html_url":"https://github.com/jagregory/fluent-nhibernate/issues/329","id":111647170,"number":329,"title":"In ClassMap, DiscriminateSubClassesOnColumn with Map throws an odd error","user":{"login":"bradlis7","id":7062604,"avatar_url":"https://avatars.githubusercontent.com/u/7062604?v=3","gravatar_id":"","url":"https://api.github.com/users/bradlis7","html_url":"https://github.com/bradlis7","followers_url":"https://api.github.com/users/bradlis7/followers","following_url":"https://api.github.com/users/bradlis7/following{/other_user}","gists_url":"https://api.github.com/users/bradlis7/gists{/gist_id}","starred_url":"https://api.github.com/users/bradlis7/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradlis7/subscriptions","organizations_url":"https://api.github.com/users/bradlis7/orgs","repos_url":"https://api.github.com/users/bradlis7/repos","events_url":"https://api.github.com/users/bradlis7/events{/privacy}","received_events_url":"https://api.github.com/users/bradlis7/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":6,"created_at":"2015-10-15T15:49:13Z","updated_at":"2015-11-19T20:13:25Z","closed_at":"2015-11-19T20:13:25Z","body":"In my ClassMap, I had this:\r\n\r\n    Map(x => x.Column);\r\n    DiscriminateSubClassesOnColumn(\"Column\");\r\n\r\nThe error was something like this when trying to insert certain items:\r\n\r\n    Invalid index 4 for this SqlParameterCollection with Count=4\r\n\r\nThere really wasn't much to go on for debugging. The fix was to add `.ReadOnly()` to the `DiscriminateSubClassesOnColumn(\"Column\")` call.\r\n\r\nI'd be ok with adding something to the documentation, but this was not an easy bug to troubleshoot."}}