{"action":"opened","issue":{"url":"https://api.github.com/repos/linq2db/linq2db/issues/961","repository_url":"https://api.github.com/repos/linq2db/linq2db","labels_url":"https://api.github.com/repos/linq2db/linq2db/issues/961/labels{/name}","comments_url":"https://api.github.com/repos/linq2db/linq2db/issues/961/comments","events_url":"https://api.github.com/repos/linq2db/linq2db/issues/961/events","html_url":"https://github.com/linq2db/linq2db/issues/961","id":284585059,"number":961,"title":"Add support for fluent mapping of ExpressionPredicate","user":{"login":"nathan-parkinson","id":18175816,"avatar_url":"https://avatars3.githubusercontent.com/u/18175816?v=4","gravatar_id":"","url":"https://api.github.com/users/nathan-parkinson","html_url":"https://github.com/nathan-parkinson","followers_url":"https://api.github.com/users/nathan-parkinson/followers","following_url":"https://api.github.com/users/nathan-parkinson/following{/other_user}","gists_url":"https://api.github.com/users/nathan-parkinson/gists{/gist_id}","starred_url":"https://api.github.com/users/nathan-parkinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nathan-parkinson/subscriptions","organizations_url":"https://api.github.com/users/nathan-parkinson/orgs","repos_url":"https://api.github.com/users/nathan-parkinson/repos","events_url":"https://api.github.com/users/nathan-parkinson/events{/privacy}","received_events_url":"https://api.github.com/users/nathan-parkinson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-12-26T17:18:05Z","updated_at":"2017-12-26T17:18:05Z","closed_at":null,"author_association":"NONE","body":"Please can the option to use fluently mapping to set an ExpressionPredicate be added to linq2db.  \r\n\r\nSome thing like \r\n```c#\r\nmapper.Entity<Person>()\r\n    .Association(x => x.Address, x => x.AddressId, y => y.AddressId, (x, y) => !y.IsDeleted)\r\n```\r\nSorry if this is already in the library.  I have looked but cannot see a way to do this.  \r\n\r\nThis would do\r\n```c#\r\nmapper.Entity<Person>()\r\n    .Association(x => x.Address, x => x.AddressId, y => y.AddressId, nameof(Person.AddressPredicate));\r\n```\r\nBut it would be nicer to not have to add a property to the model class just for the ORM mappings.  It seems a shame to avoid all the attributes in the model and then have to add a property for none standard joins.\r\n\r\nCurrently, this seems to be the only way to add ExpressionPredicate without using attributes \r\n\r\n```c#\r\nmapper.Entity<Person>()\r\n    .HasAttribute(new AssociationAttribute() \r\n    { \r\n        Storage = nameof(Person.Address), \r\n        CanBeNull = true, \r\n        ThisKey = nameof(Person.AddressId), \r\n        OtherKey = nameof(Address.AddressId), \r\n        ExpressionPredicate = nameof(Person.AddressPredicate) \r\n    });\r\n```\r\n"}}
{"actor":{"display_login":"nathan-parkinson"}}