Advertisement
Guest User

Untitled

a guest
May 5th, 2010
805
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 2.32 KB | None | 0 0
  1.  
  2. Index: src/DbMetal/Generator/CodeDomGenerator.cs
  3. ===================================================================
  4. --- src/DbMetal/Generator/CodeDomGenerator.cs   (revision 1408)
  5. +++ src/DbMetal/Generator/CodeDomGenerator.cs   (working copy)
  6. @@ -879,7 +879,7 @@
  7.  
  8.          CodeTypeMember CreateChangedMethodDecl(Column column)
  9.          {
  10. -            return CreatePartialMethod(GetChangedMethodName(column.Member));
  11. +            return CreatePartialMethod(GetChangedMethodName(column.Member ?? column.Name));
  12.          }
  13.  
  14.          static string GetChangingMethodName(string columnName)
  15. @@ -889,7 +889,7 @@
  16.  
  17.          CodeTypeMember CreateChangingMethodDecl(Column column)
  18.          {
  19. -            return CreatePartialMethod(GetChangingMethodName(column.Member),
  20. +            return CreatePartialMethod(GetChangingMethodName(column.Member ?? column.Name),
  21.                      new CodeParameterDeclarationExpression(ToCodeTypeReference(column), "value"));
  22.          }
  23.  
  24. @@ -937,7 +937,7 @@
  25.  
  26.          static string GetStorageFieldName(Column column)
  27.          {
  28. -            return GetStorageFieldName(column.Storage ?? column.Member);
  29. +            return GetStorageFieldName(column.Storage ?? column.Member ?? column.Name);
  30.          }
  31.  
  32.          static string GetStorageFieldName(string storage)
  33. Index: src/DbMetal/Generator/Implementation/Processor.cs
  34. ===================================================================
  35. --- src/DbMetal/Generator/Implementation/Processor.cs   (revision 1408)
  36. +++ src/DbMetal/Generator/Implementation/Processor.cs   (working copy)
  37. @@ -138,7 +138,7 @@
  38.              foreach (var association in table.Type.Associations)
  39.              {
  40.                  var otherType           = database.Tables.Single(t => t.Type.Name == association.Type).Type;
  41. -                var otherAssociation    = otherType.Associations.Single(a => a.Type == table.Type.Name && a.ThisKey == association.OtherKey);
  42. +                var otherAssociation    = otherType.Associations.Single(a => a.Type == table.Type.Name && a.ThisKey == association.OtherKey && a.OtherKey == association.ThisKey);
  43.                  var otherColumn         = otherType.Columns.Single(c => c.Member == association.OtherKey);
  44.  
  45.                  if (association.CardinalitySpecified && association.Cardinality == Cardinality.Many && association.IsForeignKey)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement