New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Association Property names #2803
Comments
Without seeing your schema or knowing which DB you're using, I'm not sure off the top of my head why it's generating that name for the FK link, but you can change it if you want. Open the GetFK("<tablename>", "<db_fk_name>")
.MemberName = "DeleteRecordCatableFinancings"; This will tell the generator to use the new name instead of the one it defaulted to based on the FK name. You can do this for each FK that you want to change names for. |
See here for more information on how to modify the generated code. |
@myabdolmaleki, for such case we have introduced callback methods: // Defines method to generate name for "one" side of association
Func<ForeignKey, string> GetAssociationExtensionSingularName
= GetAssociationExtensionSingularNameDefault;
// Defines method to generate name for "many" side of association
Func<ForeignKey, string> GetAssociationExtensionPluralName
= GetAssociationExtensionPluralNameDefault; |
Hi Im looking for automatic way(auto detect by linq2db) , these approaches you said are handy, my database is sql server. I have to say "DeleteRecCarta22951Afds" is constraint name in sql server. I want linq2db auto detect correct name for association property based on target property type, not based on constraints names in database like sql server, like entity framework. Thanks |
I don't get that. Many users have different naming conventions. So we have implemented callback mechanism to define exactly what is needed. |
hi
im using linq2db in my projects and its wonderful, but i have a question.
why it create property names like DeleteRecCarta22951Afds? but my Association Property Type is a List of DeleteRecordCatableFinancing class.
linq2db can generate association property name like "DeleteRecordCatableFinancings"?
thanks a lot
The text was updated successfully, but these errors were encountered: