views:

121

answers:

1

I created classes:

public class Country
{
  public long CountryId {get;set;}
  public string CountryName {get;set;}
}

public class Profile
{
  public long ProfileId {get;set;}
  public string ProfileName {get;set;}
  public Country Country {get;set;}
}

and configuration for Profile:

public class ProfileConfiguration : EntityConfiguration<Profile>
{
  public IlluminatiCoreProfileConfiguration()
  {
    Relation(p => p.Country);
  }
}

Then I create context and run context.CreateDatabase(). New database contains table Profiles with column Country_CountryId. How can I write configuration for changing column name to "CountryId"?

Thanks.

A: 

Could you try using StoreNameAttribute (found here: http://blogs.msdn.com/efdesign/)?

public class Profile
{
    public long ProfileId {get;set;}
    public string ProfileName {get;set;}
    [StoreName("CountryId")]
    public Country Country {get;set;}
}
LukLed
It is not implemented, as I see?
Victor
@Victor: Sorry, that was just a suggestion. Since it was mentioned on Microsoft blog, it should be implemented. If it is not, sorry for misleading.
LukLed