Id with Foreign Generator

Richard Gavel's Avatar

Richard Gavel

17 May, 2010 06:39 PM via web

I have a set of classes similar to the following:

class Company
public string Id;

class CompanyCriteria
public Company Company;

CompanyCriteria is mapped to COMPANY_CRITERIA with the key column being COMPANY_ID, which comes from CompanyCriteria.Company.Id. I managed to get this to map via the following:

Id("COMPANY_ID")

            .GeneratedBy.Foreign("Company");

This doesn't seem like ideal syntax. Couldn't the parameter to Foreign be exposed as an expression instead?

  1. Support Staff 2 Posted by Paul Batum on 18 May, 2010 11:54 AM

    Paul Batum's Avatar

    I think an overload that took an expression is a great idea. Patches welcome :)

    http://wiki.fluentnhibernate.org/Contributing

Reply to this discussion

Preview Comments are parsed with Markdown. Help with syntax

Attached Files

    You can attach files up to 10MB

    What is the opposite of north?