I have a table that contains information from many customers
ID | employeename | customerId
------------------------------
1 | employee1 | 188
2 | employee2 | 188
3 | employee3 | 177
Now I would like to get only those employees, whose customerId is 188. How do I map this with Fluent NHibernate so, that on update and delete there would also be WHERE customerId = 188
?
Current Mapping is something like:
Id(x => x.Id);
Map(x => x.Name).Column("employeename");
Map(x => x.CustomerId).Column("customerId");
Adding Where("customerId = 188")
only results custom where clause in SELECT. I would need following UPDATE-clause to happen on saveorupdate.
UPDATE employees SET employeename="employ" WHERE ID = 2 AND customerId = 188;