Updates referencesource to .NET 4.7
[mono-project.git] / mcs / class / referencesource / System.Data.Entity / System / Data / Common / CommandTrees / DbDeleteCommandTree.cs
blob22ccf2dafb20a957ac18443cab9ed95b88cbb727
1 //---------------------------------------------------------------------
2 // <copyright file="DbDeleteCommandTree.cs" company="Microsoft">
3 // Copyright (c) Microsoft Corporation. All rights reserved.
4 // </copyright>
5 //
6 // @owner Microsoft, Microsoft
7 // @backupOwner Microsoft
8 //---------------------------------------------------------------------
10 using System;
11 using System.Collections.Generic;
13 using System.Data.Metadata.Edm;
14 using System.Data.Common.CommandTrees.Internal;
15 using System.Data.Common.Utils;
17 namespace System.Data.Common.CommandTrees
19 /// <summary>
20 /// Represents a single row delete operation expressed as a canonical command tree.
21 /// </summary>
22 [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Naming", "CA1709:IdentifiersShouldBeCasedCorrectly", MessageId = "Db")]
23 public sealed class DbDeleteCommandTree : DbModificationCommandTree
25 private readonly DbExpression _predicate;
27 internal DbDeleteCommandTree(MetadataWorkspace metadata, DataSpace dataSpace, DbExpressionBinding target, DbExpression predicate)
28 : base(metadata, dataSpace, target)
30 EntityUtil.CheckArgumentNull(predicate, "predicate");
32 this._predicate = predicate;
35 /// <summary>
36 /// Gets an <see cref="DbExpression"/> that specifies the predicate used to determine which members of the target collection should be deleted.
37 /// </summary>
38 /// <remarks>
39 /// The predicate can include only the following elements:
40 /// <list>
41 /// <item>Equality expression</item>
42 /// <item>Constant expression</item>
43 /// <item>IsNull expression</item>
44 /// <item>Property expression</item>
45 /// <item>Reference expression to the target</item>
46 /// <item>And expression</item>
47 /// <item>Or expression</item>
48 /// <item>Not expression</item>
49 /// </list>
50 /// </remarks>
51 public DbExpression Predicate
53 get
55 return _predicate;
59 internal override DbCommandTreeKind CommandTreeKind
61 get { return DbCommandTreeKind.Delete; }
64 internal override bool HasReader
66 get
68 // a delete command never returns server-gen values, and
69 // therefore never returns a reader
70 return false;
74 internal override void DumpStructure(ExpressionDumper dumper)
76 base.DumpStructure(dumper);
78 if (this.Predicate != null)
80 dumper.Dump(this.Predicate, "Predicate");
84 internal override string PrintTree(ExpressionPrinter printer)
86 return printer.Print(this);