Skip to content

Commit c867a53

Browse files
committed
Improved DeleteDataHint.ToString()
1 parent c1f45df commit c867a53

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Orm/Xtensive.Orm/Modelling/Comparison/Hints/DeleteDataHint.cs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -62,12 +62,13 @@ internal enum DeleteDataHintInfo : byte
6262
public override string ToString()
6363
{
6464
return string.Format(
65-
"Delete from '{0}' where ({1}){2}{3}",
65+
"Delete from '{0}' {1}{2}{3}",
6666
SourceTablePath,
67-
string.Join(" and ",
68-
Identities.Select(pair => pair.ToString()).ToArray()),
67+
(Identities.Count > 0)
68+
? "where (" + string.Join(" and ", Identities.Select(pair => pair.ToString()).ToArray()) + ")"
69+
: string.Empty,
6970
PostCopy ? " (after data copying)" : string.Empty,
70-
DueToTableOwnerChange ? " due to table changed owner type" : string.Empty);
71+
DueToTableOwnerChange ? " (due to table changed owner type)" : string.Empty);
7172
}
7273

7374
// Constructors
@@ -103,7 +104,7 @@ public DeleteDataHint(string sourceTablePath, IList<IdentityPair> identities, b
103104
/// <param name="dueToOnwerChange"><see langword="true"/> if reason of deletion is the table <paramref name="sourceTablePath"/>
104105
/// has changed assigned type.</param>
105106
public DeleteDataHint(string sourceTablePath, IList<IdentityPair> identities, bool postCopy, bool dueToOnwerChange)
106-
: this(sourceTablePath, identities)
107+
: base(sourceTablePath, identities)
107108
{
108109
if (postCopy) {
109110
info |= DeleteDataHintInfo.PostCopy;

0 commit comments

Comments
 (0)