I have two tables
Table A:
Id | Attachment_id
1 | 123
Table B:
Id | doc_name |Attachment_id | version
1 | sab.txt | 123 | 1
2 | sab.txt | 123 | 2
When i upload a file with same name and content it is saved with increasing versions. As the attachment_id is repeating it's causing a blow up. Can you please let me know how to provide the FluentNhibernate mappings to fetch only the latest version of the doc (i.e 2, sab.txt,123,2)