Skip to content

Commit cec9c87

Browse files
Merge pull request #12554 from dotnet/main
Merge main into live
2 parents 357ee8f + 5f0cd21 commit cec9c87

150 files changed

Lines changed: 1294 additions & 1030 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 101 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,101 @@
1+
using System;
2+
using System.Collections.Generic;
3+
using System.Linq;
4+
using System.Text;
5+
using System.Data.Linq;
6+
using System.Data.Linq.Mapping;
7+
8+
namespace cs_maketables
9+
{
10+
class Program
11+
{
12+
static void Main(string[] args)
13+
{
14+
}
15+
}
16+
17+
// <Snippet1>
18+
[Table(Name = "Customers")]
19+
public class Customer
20+
{
21+
// ...
22+
}
23+
// </Snippet1>
24+
25+
// <Snippet2>
26+
[Table(Name = "Customers")]
27+
public class customer
28+
{
29+
[Column(Name = "CustomerID")]
30+
public string CustomerID;
31+
// ...
32+
}
33+
// </Snippet2>
34+
}
35+
36+
// <Snippet3>
37+
[Table(Name = "Customers")]
38+
public partial class Customer
39+
{
40+
[Column(IsPrimaryKey = true)]
41+
public string CustomerID;
42+
// ...
43+
private EntitySet<Order> _Orders;
44+
[Association(Storage = "_Orders", OtherKey = "CustomerID")]
45+
public EntitySet<Order> Orders
46+
{
47+
get { return this._Orders; }
48+
set { this._Orders.Assign(value); }
49+
}
50+
}
51+
// </Snippet3>
52+
53+
// <Snippet4>
54+
[Table]
55+
[InheritanceMapping(Code = "C", Type = typeof(Car))]
56+
[InheritanceMapping(Code = "T", Type = typeof(Truck))]
57+
[InheritanceMapping(Code = "V", Type = typeof(Vehicle),
58+
IsDefault = true)]
59+
public class Vehicle
60+
{
61+
[Column(IsDiscriminator = true)]
62+
public string DiscKey;
63+
[Column(IsPrimaryKey = true)]
64+
public string VIN;
65+
[Column]
66+
public string MfgPlant;
67+
}
68+
public class Car : Vehicle
69+
{
70+
[Column]
71+
public int TrimCode;
72+
[Column]
73+
public string ModelName;
74+
}
75+
76+
public class Truck : Vehicle
77+
{
78+
[Column]
79+
public int Tonnage;
80+
[Column]
81+
public int Axles;
82+
}
83+
// </Snippet4>
84+
85+
// <Snippet5>
86+
[Table(Name = "Orders")]
87+
public class Order
88+
{
89+
[Column(IsPrimaryKey = true)]
90+
public int OrderID;
91+
[Column]
92+
public string CustomerID;
93+
private EntityRef<Customer> _Customer;
94+
[Association(Storage = "_Customer", ThisKey = "CustomerID")]
95+
public Customer Customer
96+
{
97+
get { return this._Customer.Entity; }
98+
set { this._Customer.Entity = value; }
99+
}
100+
}
101+
// </Snippet5>
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Library</OutputType>
5+
<TargetFramework>net48</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Reference Include="System.Data.Linq" />
10+
</ItemGroup>
11+
12+
</Project>
Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
Imports System.Data.Linq
2+
Imports System.Data.Linq.Mapping
3+
4+
Module Module1
5+
Sub Main()
6+
7+
End Sub
8+
9+
End Module
10+
11+
' <Snippet1>
12+
<Table(Name:="Customers")>
13+
Public Class Customer
14+
' ...
15+
End Class
16+
' </Snippet1>
17+
18+
Namespace ns
19+
20+
' <Snippet2>
21+
<Table(Name:="Customers")>
22+
Public Class Customer
23+
<Column(Name:="CustomerID")>
24+
Public CustomerID As String
25+
' ...
26+
End Class
27+
' </Snippet2>
28+
29+
End Namespace
30+
31+
Namespace ns2
32+
33+
' <Snippet3>
34+
<Table(Name:="Customers")>
35+
Public Class Customer
36+
<Column(IsPrimaryKey:=True)>
37+
Public CustomerID As String
38+
' ...
39+
Private _orders As EntitySet(Of Order)
40+
<Association(Storage:="_Orders", OtherKey:="CustomerID")>
41+
Public Property Orders() As EntitySet(Of Order)
42+
Get
43+
Return _orders
44+
End Get
45+
Set(ByVal value As EntitySet(Of Order))
46+
_orders.Assign(value)
47+
End Set
48+
End Property
49+
End Class
50+
' </Snippet3>
51+
52+
' <Snippet4>
53+
<Table()>
54+
<InheritanceMapping(Code:="C", Type:=GetType(Car))>
55+
<InheritanceMapping(Code:="T", Type:=GetType(Truck))>
56+
<InheritanceMapping(Code:="V", Type:=GetType(Vehicle),
57+
IsDefault:=True)>
58+
Public Class Vehicle
59+
<Column(IsDiscriminator:=True)>
60+
Private _discKey As String
61+
<Column(IsPrimaryKey:=True)>
62+
Private _vIN As String
63+
<Column()>
64+
Private _mfgPlant As String
65+
End Class
66+
67+
Public Class Car
68+
Inherits Vehicle
69+
<Column()>
70+
Private _trimCode As Integer
71+
<Column()>
72+
Private _modelName As String
73+
End Class
74+
75+
Public Class Truck
76+
Inherits Vehicle
77+
<Column()>
78+
Private _tonnage As Integer
79+
<Column()>
80+
Private _axles As Integer
81+
End Class
82+
' </Snippet4>
83+
84+
' <Snippet5>
85+
<Table(Name:="Orders")>
86+
Public Class Order
87+
<Column(IsPrimaryKey:=True)>
88+
Public OrderID As Integer
89+
<Column()>
90+
Public CustomerID As String
91+
Private _customer As EntityRef(Of Customer)
92+
<Association(Storage:="Customer", ThisKey:="CustomerID")>
93+
Public Property Customer() As Customer
94+
Get
95+
Return _customer.Entity
96+
End Get
97+
Set(ByVal value As Customer)
98+
_customer.Entity = value
99+
End Set
100+
End Property
101+
End Class
102+
' </Snippet5>
103+
104+
End Namespace
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
<Project Sdk="Microsoft.NET.Sdk">
2+
3+
<PropertyGroup>
4+
<OutputType>Exe</OutputType>
5+
<TargetFramework>net48</TargetFramework>
6+
</PropertyGroup>
7+
8+
<ItemGroup>
9+
<Reference Include="System.Data.Linq" />
10+
</ItemGroup>
11+
12+
</Project>

xml/Microsoft.CSharp/CSharpCodeProvider.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -174,7 +174,7 @@ In .NET Framework apps, you can obtain the value for `providerOptions` from the
174174
<altmember cref="T:System.CodeDom.Compiler.CodeDomProvider" />
175175
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/">Configuration file schema for the .NET Framework</related>
176176
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/compiler/compilers-element">&lt;compilers&gt; Element</related>
177-
<related type="Article" href="/dotnet/framework/reflection-and-codedom/specifying-fully-qualified-type-names">Specifying Fully Qualified Type Names</related>
177+
<related type="Article" href="/dotnet/fundamentals/reflection/specifying-fully-qualified-type-names">Specifying Fully Qualified Type Names</related>
178178
<related type="Article" href="/dotnet/framework/configure-apps/file-schema/compiler/provideroption-element">&lt;provideroption&gt; Element</related>
179179
</Docs>
180180
</Member>

xml/Microsoft.CSharp/Compiler.xml

Lines changed: 24 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -79,29 +79,29 @@ For the `options` parameter, the key is the short form of the compiler option. T
7979
8080
| Key Name | Usage |
8181
| --- | --- |
82-
| `addmodule` | List of modules to include in this assembly. The module names must be separated by the vertical bar or pipe character. Value must be of type <xref:System.String>. See [-addmodule (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/addmodule-compiler-option). |
83-
| `baseaddress` | Base address for libraries. Value must be of type <xref:System.UInt32>. See [-baseaddress (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/baseaddress-compiler-option). |
84-
| `bugreport` | Produces bug report file. Value must be of type <xref:System.String>. See [-bugreport (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/bugreport-compiler-option). |
85-
| `checked` | Set default expression evaluation to checked (or unchecked). Value must be of type <xref:System.Boolean>. See [-checked (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/checked-compiler-option). |
86-
| `d` | List of semicolon separated symbols to define. Value must be of type <xref:System.String>. See [-define (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/define-compiler-option). |
87-
| `debug` | Emit debug information with output. Value must be of type <xref:System.Boolean>. Full or pdb-only cannot be specified. See [-debug (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/debug-compiler-option). |
88-
| `doc` | File name to put XML comments in. Value must be of type <xref:System.String>. See [-doc (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/doc-compiler-option). |
89-
| `filealign` | PE section alignment size. Value must be of type <xref:System.UInt32>. See [-filealign (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/filealign-compiler-option). |
82+
| `addmodule` | List of modules to include in this assembly. The module names must be separated by the vertical bar or pipe character. Value must be of type <xref:System.String>. See [-addmodule (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/inputs). |
83+
| `baseaddress` | Base address for libraries. Value must be of type <xref:System.UInt32>. See [-baseaddress (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/advanced). |
84+
| `bugreport` | Produces bug report file. Value must be of type <xref:System.String>. See [-bugreport (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/). |
85+
| `checked` | Set default expression evaluation to checked (or unchecked). Value must be of type <xref:System.Boolean>. See [-checked (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/language). |
86+
| `d` | List of semicolon separated symbols to define. Value must be of type <xref:System.String>. See [-define (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/language). |
87+
| `debug` | Emit debug information with output. Value must be of type <xref:System.Boolean>. Full or pdb-only cannot be specified. See [-debug (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/code-generation). |
88+
| `doc` | File name to put XML comments in. Value must be of type <xref:System.String>. See [-doc (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/output). |
89+
| `filealign` | PE section alignment size. Value must be of type <xref:System.UInt32>. See [-filealign (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/advanced). |
9090
| `incr` | Enable incremental rebuild. Value must be of type <xref:System.Boolean>. |
91-
| `lib` | Additional paths to search when locating modules and referenced assemblies. Value must be of type <xref:System.String>. See [-lib (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/lib-compiler-option). |
92-
| `linkres` | Link a managed resource to the assembly. Value must be of type <xref:System.String>. See [-linkresource (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/linkresource-compiler-option). |
93-
| `m` | Type to search in for the Main method. Value must be of type <xref:System.String>. See [-main (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/main-compiler-option). |
94-
| `nostdlib` | Do not auto-reference mscorlib.dll. Value must be of type <xref:System.Boolean>. See [-nostdlib (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/nostdlib-compiler-option). |
95-
| `nowarn` | List of semicolon separated warning numbers to not report. Value must be of type <xref:System.String>. See [-nowarn (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/nowarn-compiler-option). |
96-
| `o` | Enable compiler optimizations. Value must be of type <xref:System.Boolean>. See [-optimize (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/optimize-compiler-option). |
97-
| `r` | Referenced assemblies. Value must be of type String. If more than one assembly is specified, the file name must be separated by the vertical bar or pipe character. See [-reference (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/reference-compiler-option). |
98-
| `res` | Embed a managed resource. Value must be of type <xref:System.String>. See [-resource (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/resource-compiler-option). |
99-
| `target` | Output file target type, one of the following: "library", "exe", "winexe", or "module". Value must be of type <xref:System.String>. See [-target (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/target-compiler-option). |
100-
| `unsafe` | Allow unsafe constructs. Value must be of type <xref:System.Boolean>. See [-unsafe (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/unsafe-compiler-option). |
101-
| `w` | Warning level (0-4). Value must be of type <xref:System.String>. See [-warn (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/warn-compiler-option). |
102-
| `warnaserror` | Report warning diagnostics as errors. Value must be of type <xref:System.Boolean>. See [-warnaserror (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/warnaserror-compiler-option). |
103-
| `win32icon` | Win32 icon for auto generated Win32 resource. Value must be of type <xref:System.String>. See [-win32icon (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/win32icon-compiler-option). |
104-
| `win32res` | Win32 resource file. Value must be of type <xref:System.String>. See [-win32res (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/win32res-compiler-option). |
91+
| `lib` | Additional paths to search when locating modules and referenced assemblies. Value must be of type <xref:System.String>. See [-lib (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/advanced). |
92+
| `linkres` | Link a managed resource to the assembly. Value must be of type <xref:System.String>. See [-linkresource (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/resources). |
93+
| `m` | Type to search in for the Main method. Value must be of type <xref:System.String>. See [-main (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/advanced). |
94+
| `nostdlib` | Do not auto-reference mscorlib.dll. Value must be of type <xref:System.Boolean>. See [-nostdlib (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/advanced). |
95+
| `nowarn` | List of semicolon separated warning numbers to not report. Value must be of type <xref:System.String>. See [-nowarn (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/errors-warnings). |
96+
| `o` | Enable compiler optimizations. Value must be of type <xref:System.Boolean>. See [-optimize (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/code-generation). |
97+
| `r` | Referenced assemblies. Value must be of type String. If more than one assembly is specified, the file name must be separated by the vertical bar or pipe character. See [-reference (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/inputs). |
98+
| `res` | Embed a managed resource. Value must be of type <xref:System.String>. See [-resource (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/resources). |
99+
| `target` | Output file target type, one of the following: "library", "exe", "winexe", or "module". Value must be of type <xref:System.String>. See [-target (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/output). |
100+
| `unsafe` | Allow unsafe constructs. Value must be of type <xref:System.Boolean>. See [-unsafe (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/language). |
101+
| `w` | Warning level (0-4). Value must be of type <xref:System.String>. See [-warn (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/errors-warnings). |
102+
| `warnaserror` | Report warning diagnostics as errors. Value must be of type <xref:System.Boolean>. See [-warnaserror (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/errors-warnings). |
103+
| `win32icon` | Win32 icon for auto generated Win32 resource. Value must be of type <xref:System.String>. See [-win32icon (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/resources). |
104+
| `win32res` | Win32 resource file. Value must be of type <xref:System.String>. See [-win32res (C# Compiler Options)](/dotnet/csharp/language-reference/compiler-options/resources). |
105105
106106
]]></format>
107107
</remarks>
@@ -124,8 +124,8 @@ For the `options` parameter, the key is the short form of the compiler option. T
124124

125125
<paramref name="sourceTextNames" /> is not the same size as <paramref name="sourceTexts" />.
126126
</exception>
127-
<related type="Article" href="/dotnet/csharp/language-reference/preprocessor-directives/preprocessor-line">#line (C# Reference)</related>
128-
<related type="Article" href="/dotnet/csharp/language-reference/compiler-options/reference-compiler-option">-reference (C# Compiler Options)</related>
127+
<related type="Article" href="/dotnet/csharp/language-reference/preprocessor-directives">#line (C# Reference)</related>
128+
<related type="Article" href="/dotnet/csharp/language-reference/compiler-options/inputs">-reference (C# Compiler Options)</related>
129129
<related type="Article" href="/dotnet/csharp/language-reference/compiler-options/">C# Compiler Options</related>
130130
</Docs>
131131
</Member>

xml/System.AddIn.Contract.Automation/RemoteParameterData.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@
128128
129129
The value of this field is always `false` if this <xref:System.AddIn.Contract.Automation.RemoteParameterData> describes a parameter of a method provided by a COM object.
130130
131-
Parameters that can have a variable number of arguments are specified by the `params` (for Visual C#) and `ParamArray` (for Visual Basic) keywords. For more information, see [params](/dotnet/csharp/language-reference/keywords/params) and [ParamArray](/dotnet/visual-basic/language-reference/modifiers/paramarray).
131+
Parameters that can have a variable number of arguments are specified by the `params` (for Visual C#) and `ParamArray` (for Visual Basic) keywords. For more information, see [params](/dotnet/csharp/language-reference/keywords/method-parameters) and [ParamArray](/dotnet/visual-basic/language-reference/modifiers/paramarray).
132132
133133
]]></format>
134134
</remarks>

xml/System.CodeDom.Compiler/CodeCompiler.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
<xref:System.CodeDom.Compiler.CodeCompiler> is a useful utility base class for code generators to derive from in order to provide code compilation functions.
4545
4646
> [!NOTE]
47-
> This class contains a link demand and an inheritance demand at the class level that applies to all members. A <xref:System.Security.SecurityException> is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands).
47+
> This class contains a link demand and an inheritance demand at the class level that applies to all members. A <xref:System.Security.SecurityException> is thrown when either the immediate caller or the derived class does not have full-trust permission.
4848
4949
]]></format>
5050
</remarks>

xml/System.CodeDom.Compiler/CodeDomProvider.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@
5959
For more details on language provider settings in the configuration file, see [Compiler and Language Provider Settings Schema](/dotnet/framework/configure-apps/file-schema/compiler/).
6060
6161
> [!NOTE]
62-
> This class makes a link demand and an inheritance demand at the class level. A <xref:System.Security.SecurityException> is thrown if either the immediate caller or the derived class does not have full trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands).
62+
> This class makes a link demand and an inheritance demand at the class level. A <xref:System.Security.SecurityException> is thrown if either the immediate caller or the derived class does not have full trust permission.
6363
6464
6565

xml/System.CodeDom.Compiler/CodeGenerator.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444
This is a useful base class for code generators to derive from. Code generators are capable of rendering source code in a specific language according to the structure of a Code Document Object Model (CodeDOM) graph. This class provides many functions and methods to generate specific types of code from a CodeDOM graph.
4545
4646
> [!NOTE]
47-
> This class contains a link demand and an inheritance demand at the class level that applies to all members. A <xref:System.Security.SecurityException> is thrown when either the immediate caller or the derived class does not have full-trust permission. For details about security demands, see [Link Demands](/dotnet/framework/misc/link-demands).
47+
> This class contains a link demand and an inheritance demand at the class level that applies to all members. A <xref:System.Security.SecurityException> is thrown when either the immediate caller or the derived class does not have full-trust permission.
4848
4949
]]></format>
5050
</remarks>

0 commit comments

Comments
 (0)