Client Id
is mapped twice, once in your cAdministratorsKey
mapping and again in your Cliente mapping
.
Remove the Cliente
mapping and change the cAdministratorsKey
mapping to include a reference to the Cliente
property as shown below:
CompositeId<cAdministratorsKey>(c => c.Key)
.KeyReference(x => x.Cliente, "client_id") // Changed to KeyReference
.KeyProperty(x => x.Start_date, kp => kp.ColumnName("start_date").Type(DbType.Date.ToString()))
.KeyProperty(x => x.Adm_type, kp => kp.ColumnName("adm_type").Type(DbType.AnsiString.ToString()));
// References(x => x.Cliente).Column("client_id"); Removed as not needed
This should remove the duplication and fix your issue.