Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Index: src/DbMetal/Generator/CodeDomGenerator.cs
- ===================================================================
- --- src/DbMetal/Generator/CodeDomGenerator.cs (revision 1408)
- +++ src/DbMetal/Generator/CodeDomGenerator.cs (working copy)
- @@ -879,7 +879,7 @@
- CodeTypeMember CreateChangedMethodDecl(Column column)
- {
- - return CreatePartialMethod(GetChangedMethodName(column.Member));
- + return CreatePartialMethod(GetChangedMethodName(column.Member ?? column.Name));
- }
- static string GetChangingMethodName(string columnName)
- @@ -889,7 +889,7 @@
- CodeTypeMember CreateChangingMethodDecl(Column column)
- {
- - return CreatePartialMethod(GetChangingMethodName(column.Member),
- + return CreatePartialMethod(GetChangingMethodName(column.Member ?? column.Name),
- new CodeParameterDeclarationExpression(ToCodeTypeReference(column), "value"));
- }
- @@ -937,7 +937,7 @@
- static string GetStorageFieldName(Column column)
- {
- - return GetStorageFieldName(column.Storage ?? column.Member);
- + return GetStorageFieldName(column.Storage ?? column.Member ?? column.Name);
- }
- static string GetStorageFieldName(string storage)
- Index: src/DbMetal/Generator/Implementation/Processor.cs
- ===================================================================
- --- src/DbMetal/Generator/Implementation/Processor.cs (revision 1408)
- +++ src/DbMetal/Generator/Implementation/Processor.cs (working copy)
- @@ -138,7 +138,7 @@
- foreach (var association in table.Type.Associations)
- {
- var otherType = database.Tables.Single(t => t.Type.Name == association.Type).Type;
- - var otherAssociation = otherType.Associations.Single(a => a.Type == table.Type.Name && a.ThisKey == association.OtherKey);
- + var otherAssociation = otherType.Associations.Single(a => a.Type == table.Type.Name && a.ThisKey == association.OtherKey && a.OtherKey == association.ThisKey);
- var otherColumn = otherType.Columns.Single(c => c.Member == association.OtherKey);
- if (association.CardinalitySpecified && association.Cardinality == Cardinality.Many && association.IsForeignKey)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement