Where() clause with many-to-many relation is missing (solution in description)

Description

Solution in 3 steps:

1) Add new interface method to IManyToManyMapper interface:

public interface IManyToManyMapper : IColumnsMapper
{
...
void Where(string sqlWhereClause);
...
}

2) Implement new method in ManyToManyCustomizer class:

public void Where(string sqlWhereClause)
{
customizersHolder.AddCustomizer(propertyPath, (IManyToManyMapper x) => x.Where(sqlWhereClause));
}

3) Implement new method in ManyToManyMapper class:

public void Where(string sqlWhereClause)
{
manyToMany.where = sqlWhereClause;
}

Note) manyToMany field of ManyToManyMapper class contains a lot of interesting fields. I think these fields can be accessed in mapping by-code feature using the same approach. Need to extend IManyToManyMapper interface directly, or add additional parent interfaces to it.

Environment

None

Activity

Show:

Alex Zaytsev May 13, 2013 at 1:45 PM

Commited to master 1a5dc23d81b1fd06264e72843cf5fb2259342daf

Nick Albrecht June 28, 2012 at 11:25 PM

I'm having this exact problem as well and I'd love to see if fixed in an official capacity.

Fixed

Details

Assignee

Reporter

Labels

Components

Fix versions

Affects versions

Priority

Who's Looking?

Open Who's Looking?
Created January 7, 2012 at 8:43 AM
Updated September 21, 2014 at 12:42 PM
Resolved May 13, 2013 at 1:45 PM
Who's Looking?