forked from dotnet/dotnet-api-docs
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathScaffoldColumnAttribute.xml
209 lines (178 loc) · 10.9 KB
/
ScaffoldColumnAttribute.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
<Type Name="ScaffoldColumnAttribute" FullName="System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute">
<TypeSignature Language="C#" Value="public class ScaffoldColumnAttribute : Attribute" />
<TypeSignature Language="ILAsm" Value=".class public auto ansi beforefieldinit ScaffoldColumnAttribute extends System.Attribute" />
<TypeSignature Language="DocId" Value="T:System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute" />
<TypeSignature Language="VB.NET" Value="Public Class ScaffoldColumnAttribute
Inherits Attribute" />
<TypeSignature Language="F#" Value="type ScaffoldColumnAttribute = class
 inherit Attribute" />
<TypeSignature Language="C++ CLI" Value="public ref class ScaffoldColumnAttribute : Attribute" />
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<TypeForwardingChain>
<TypeForwarding From="System.ComponentModel.DataAnnotations" FromVersion="4.0.0.0" To="System.ComponentModel.Annotations" ToVersion="0.0.0.0" FrameworkAlternate="netcore-2.0" />
</TypeForwardingChain>
<Base>
<BaseTypeName>System.Attribute</BaseTypeName>
</Base>
<Interfaces />
<Attributes>
<Attribute>
<AttributeName Language="C#">[System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)]</AttributeName>
<AttributeName Language="F#">[<System.AttributeUsage(System.AttributeTargets.Field | System.AttributeTargets.Property, AllowMultiple=false)>]</AttributeName>
</Attribute>
</Attributes>
<Docs>
<summary>Specifies whether a class or data column uses scaffolding.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
Scaffolding is the mechanism for generating web page templates based on database schemas. ASP.NET Dynamic Data uses scaffolding to generate Web-based UI that lets a user to view and update a database. This class uses the <xref:System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute.Scaffold%2A> property to enable scaffolding in a Dynamic Data Web Site.
Scaffolding enhances ASP.NET page framework by dynamically displaying pages based on the data model with no physical pages required.
Scaffolding provides the following capabilities:
- Minimal or no code to create a data-driven Web application.
- Quick development time.
- Pages that are fully functional and include display, insert, edit, delete, sorting, and paging functionalities.
- Built-in data validation that is based on the database schema.
- Filters that are created for each foreign key or Boolean fields.
This class can be used to enable or disable scaffolding of data columns in a data model by applying this attribute to the appropriate data field object in the class that represents the table.
## Examples
The following code example exposes the ProductID column of the Products table in the AdventureWorksLT data base by applying the scaffold property to the ProductID object in the Products partial class and setting it to `true`. It hides the ThumbnailPhotoFileName column by applying the scaffold property to the ThumbnailPhotoFileName object and setting it to `false`.
```csharp
[MetadataType(typeof(ProductMetadata))]
public partial class Product
{
}
public class ProductMetadata
{
[ScaffoldColumn(true)]
public object ProductID;
[ScaffoldColumn(false)]
public object ThumbnailPhotoFileName;
}
```
```vb
<MetadataType(GetType(ProductMetadata))>
Public Partial Class Product
End Class
Public Class ProductMetadata
<ScaffoldColumn(True)>
Public ProductID As Object
<ScaffoldColumn(False)>
Public ThumbnailPhotoFileName As Object
End Class
```
To compile the example code, you need the following:
- Any edition of Visual Studio 2010 or later.
- The AdventureWorksLT sample database. For information about how to download and install the SQL Server sample database, see [Microsoft SQL Server Product Samples: Database](https://github.com/Microsoft/sql-server-samples/releases) on GitHub. Make sure that you install the correct version of the sample database for the version of SQL Server that you are running.
- A Dynamic Data Web site. This enables you to create a data context for the database and the class that contains the data field to customize and the methods to override. In addition, it creates the environment in which to use the page described before. For more information, see [Walkthrough: Creating a New Dynamic Data Web Site Using Scaffolding](/previous-versions/aspnet/cc488469(v=vs.100)).
]]></format>
</remarks>
</Docs>
<Members>
<Member MemberName=".ctor">
<MemberSignature Language="C#" Value="public ScaffoldColumnAttribute (bool scaffold);" />
<MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(bool scaffold) cil managed" />
<MemberSignature Language="DocId" Value="M:System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute.#ctor(System.Boolean)" />
<MemberSignature Language="VB.NET" Value="Public Sub New (scaffold As Boolean)" />
<MemberSignature Language="F#" Value="new System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute : bool -> System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute" Usage="new System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute scaffold" />
<MemberSignature Language="C++ CLI" Value="public:
 ScaffoldColumnAttribute(bool scaffold);" />
<MemberType>Constructor</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Parameters>
<Parameter Name="scaffold" Type="System.Boolean" />
</Parameters>
<Docs>
<param name="scaffold">The value that specifies whether scaffolding is enabled.</param>
<summary>Initializes a new instance of <see cref="T:System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute" /> using the <see cref="P:System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute.Scaffold" /> property.</summary>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can set `scaffold` to `true` for the entire data model to expose all data columns in the database for CRUD (Create, Read, Update and Delete) operations by setting `scaffold` to `true` in the Global.asax file or expose individual data columns in a data table to CRUD operations by setting `scaffold` to `true` in the partial class.
]]></format>
</remarks>
</Docs>
</Member>
<Member MemberName="Scaffold">
<MemberSignature Language="C#" Value="public bool Scaffold { get; }" />
<MemberSignature Language="ILAsm" Value=".property instance bool Scaffold" />
<MemberSignature Language="DocId" Value="P:System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute.Scaffold" />
<MemberSignature Language="VB.NET" Value="Public ReadOnly Property Scaffold As Boolean" />
<MemberSignature Language="F#" Value="member this.Scaffold : bool" Usage="System.ComponentModel.DataAnnotations.ScaffoldColumnAttribute.Scaffold" />
<MemberSignature Language="C++ CLI" Value="public:
 property bool Scaffold { bool get(); };" />
<MemberType>Property</MemberType>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.Annotations</AssemblyName>
<AssemblyVersion>4.0.10.0</AssemblyVersion>
<AssemblyVersion>4.1.0.0</AssemblyVersion>
<AssemblyVersion>4.2.0.0</AssemblyVersion>
<AssemblyVersion>4.3.0.0</AssemblyVersion>
<AssemblyVersion>4.3.1.0</AssemblyVersion>
<AssemblyVersion>5.0.0.0</AssemblyVersion>
<AssemblyVersion>6.0.0.0</AssemblyVersion>
<AssemblyVersion>7.0.0.0</AssemblyVersion>
<AssemblyVersion>8.0.0.0</AssemblyVersion>
<AssemblyVersion>9.0.0.0</AssemblyVersion>
</AssemblyInfo>
<AssemblyInfo>
<AssemblyName>System.ComponentModel.DataAnnotations</AssemblyName>
<AssemblyVersion>2.0.5.0</AssemblyVersion>
<AssemblyVersion>3.5.0.0</AssemblyVersion>
<AssemblyVersion>4.0.0.0</AssemblyVersion>
</AssemblyInfo>
<Attributes>
<Attribute FrameworkAlternate="netframework-4.0">
<AttributeName Language="C#">[get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")]</AttributeName>
<AttributeName Language="F#">[<get: System.Runtime.TargetedPatchingOptOut("Performance critical to inline this type of method across NGen image boundaries")>]</AttributeName>
</Attribute>
</Attributes>
<ReturnValue>
<ReturnType>System.Boolean</ReturnType>
</ReturnValue>
<Docs>
<summary>Gets or sets the value that specifies whether scaffolding is enabled.</summary>
<value>
<see langword="true" /> if scaffolding is enabled; otherwise, <see langword="false" />.</value>
<remarks>
<format type="text/markdown"><![CDATA[
## Remarks
You can use this property to enable scaffolding in individual data columns in a data model. If you set this property to `true` in the global.asax file, the entire data model will expose all data columns in the database for CRUD (Create, Read, Update and Delete) operations.
]]></format>
</remarks>
</Docs>
</Member>
</Members>
</Type>