Skip to content

Commit 9094335

Browse files
authored
Merge pull request #4883 from dotnet/master
Update live with current master
2 parents 8848ae2 + 830093d commit 9094335

File tree

9 files changed

+68
-117
lines changed

9 files changed

+68
-117
lines changed

docs/core/rid-catalog.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ RID is short for *Runtime IDentifier*. RID values are used to identify target pl
1515
They're used by .NET packages to represent platform-specific assets in NuGet packages. The following values are examples of RIDs: `linux-x64`, `ubuntu.14.04-x64`, `win7-x64`, or `osx.10.12-x64`.
1616
For the packages with native dependencies, the RID designates on which platforms the package can be restored.
1717

18-
RIDs can be set in the `<RuntimeIdentifier>` element of your project file. They're also used via the `--runtime` option with the following [.NET Core CLI commands](./tools/index.md):
18+
A single RID can be set in the `<RuntimeIdentifier>` element of your project file. Multiple RIDs can be defined as a semicolon-delimited list in the project file's `<RuntimeIdentifiers>` element. They're also used via the `--runtime` option with the following [.NET Core CLI commands](./tools/index.md):
1919

2020
- [dotnet build](./tools/dotnet-build.md)
2121
- [dotnet clean](./tools/dotnet-clean.md)

docs/core/tools/dotnet-store.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ The *package store manifest file* is an XML file that contains the list of packa
3838

3939
`-r|--runtime <RUNTIME_IDENTIFIER>`
4040

41-
The runtime identifier to target.
41+
The [runtime identifier](../rid-catalog.md) to target.
4242

4343
## Optional options
4444

docs/csharp/language-reference/operators/null-conditional-operators.md

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,27 @@
11
---
22
title: "Null-conditional Operators (C# and Visual Basic)"
3-
ms.date: 07/20/2015
3+
ms.date: 04/03/2015
44
ms.prod: .net
55
ms.technology:
66
- "devlang-csharp"
77
ms.topic: "article"
8+
dev_langs:
9+
- "csharp"
10+
- "vb"
11+
helpviewer_keywords:
12+
- "null-conditional operators [C#]"
13+
- "null-conditional operators [Visual Basic]"
14+
- "?. operator [C#]"
15+
- "?. operator [Visual Basic]"
16+
- "?[] operator [C#]"
17+
- "?[] operator [Visual Basic]"
818
ms.assetid: 9c7b2c8f-a785-44ca-836c-407bfb6d27f5
919
caps.latest.revision: 3
1020
author: "BillWagner"
1121
ms.author: "wiwagn"
1222
---
13-
# Null-conditional Operators (C# and Visual Basic)
14-
Used to test for null before performing a member access (`?.`) or index (`?[`) operation. These operators help you write less code to handle null checks, especially for descending into data structures.
23+
# ?. and ?[] null-conditional Operators (C# and Visual Basic)
24+
Used to test for null before performing a member access (`?.`) or index (`?[]`) operation. These operators help you write less code to handle null checks, especially for descending into data structures.
1525

1626
```csharp
1727
int? length = customers?.Length; // null if customers is null
@@ -25,16 +35,16 @@ Dim first as Customer = customers?(0) ' null if customers is null
2535
Dim count as Integer? = customers?(0)?.Orders?.Count() ' null if customers, the first customer, or Orders is null
2636
```
2737

28-
The last example demonstrates that the null-condition operators are short-circuiting. If one operation in a chain of conditional member access and index operation returns null, then the rest of the chain’s execution stops. Other operations with lower precedence in the expression continue. For example, `E` in the following executes in the second line, and the `??` and `==` operations execute. In the first line, the `??` short circuits and `E` does not execute when the left side evaluates to non-null.
38+
The null-condition operators are short-circuiting. If one operation in a chain of conditional member access and index operation returns null, then the rest of the chain’s execution stops. In the following example, `E` doesn't execute if `A`, `B`, or `C` evaluates to null.
2939

3040
```csharp
31-
A?.B?.C?[0] ?? E
32-
A?.B?.C?[0] == E
41+
A?.B?.C?.Do(E);
42+
A?.B?.C?[E];
3343
```
3444

3545
```vb
36-
A?.B?.C?(0) ?? E
37-
A?.B?.C?(0) == E
46+
A?.B?.C?.Do(E);
47+
A?.B?.C?(E);
3848
```
3949

4050
Another use for the null-condition member access is invoking delegates in a thread-safe way with much less code. The old way requires code like the following:
@@ -63,7 +73,7 @@ PropertyChanged?.Invoke(e)
6373

6474
The new way is thread-safe because the compiler generates code to evaluate `PropertyChanged` one time only, keeping the result in a temporary variable.
6575

66-
You need to explicitly call the `Invoke` method because there is no null-conditional delegate invocation syntax `PropertyChanged?(e)`. There were too many ambiguous parsing situations to allow it.
76+
You need to explicitly call the `Invoke` method because there is no null-conditional delegate invocation syntax `PropertyChanged?(e)`.
6777

6878
## Language Specifications
6979
[!INCLUDE[CSharplangspec](~/includes/csharplangspec-md.md)]

docs/csharp/programming-guide/generics/generics-and-reflection.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -34,15 +34,15 @@ Because the Common Language Runtime (CLR) has access to generic type information
3434
|<xref:System.Type.DeclaringMethod%2A>|Returns the generic method that defined the current generic type parameter, or null if the type parameter was not defined by a generic method.|
3535
|<xref:System.Type.MakeGenericType%2A>|Substitutes the elements of an array of types for the type parameters of the current generic type definition, and returns a <xref:System.Type> object representing the resulting constructed type.|
3636

37-
In addition, new members are added to the <xref:System.Reflection.MethodInfo> class to enable run-time information for generic methods. See the <xref:System.Reflection.MethodInfo.IsGenericMethod%2A> property remarks for a list of invariant conditions for terms used to reflect on generic methods.
37+
In addition, members of the <xref:System.Reflection.MethodInfo> class enable run-time information for generic methods. See the <xref:System.Reflection.MethodBase.IsGenericMethod%2A> property remarks for a list of invariant conditions for terms used to reflect on generic methods.
3838

3939
|System.Reflection.MemberInfo Member Name|Description|
4040
|----------------------------------------------|-----------------|
41-
|<xref:System.Reflection.MethodInfo.IsGenericMethod%2A>|Returns true if a method is generic.|
41+
|<xref:System.Reflection.MethodBase.IsGenericMethod%2A>|Returns true if a method is generic.|
4242
|<xref:System.Reflection.MethodInfo.GetGenericArguments%2A>|Returns an array of Type objects that represent the type arguments of a constructed generic method or the type parameters of a generic method definition.|
4343
|<xref:System.Reflection.MethodInfo.GetGenericMethodDefinition%2A>|Returns the underlying generic method definition for the current constructed method.|
44-
|<xref:System.Reflection.MethodInfo.ContainsGenericParameters%2A>|Returns true if the method or any of its enclosing types contain any type parameters for which specific types have not been supplied.|
45-
|<xref:System.Reflection.MethodInfo.IsGenericMethodDefinition%2A>|Returns true if the current <xref:System.Reflection.MethodInfo> represents the definition of a generic method.|
44+
|<xref:System.Reflection.MethodBase.ContainsGenericParameters%2A>|Returns true if the method or any of its enclosing types contain any type parameters for which specific types have not been supplied.|
45+
|<xref:System.Reflection.MethodBase.IsGenericMethodDefinition%2A>|Returns true if the current <xref:System.Reflection.MethodInfo> represents the definition of a generic method.|
4646
|<xref:System.Reflection.MethodInfo.MakeGenericMethod%2A>|Substitutes the elements of an array of types for the type parameters of the current generic method definition, and returns a <xref:System.Reflection.MethodInfo> object representing the resulting constructed method.|
4747

4848
## See Also

docs/framework/data/adonet/connection-string-syntax.md

Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ Each .NET Framework data provider has a `Connection` object that inherits from <
3939
- <xref:System.Data.OracleClient.OracleConnectionStringBuilder>
4040

4141
The connection string builders allow you to construct syntactically valid connection strings at run time, so you do not have to manually concatenate connection string values in your code. For more information, see [Connection String Builders](../../../../docs/framework/data/adonet/connection-string-builders.md).
42-
42+
4343
## Windows Authentication
4444
We recommend using Windows Authentication (sometimes referred to as *integrated security*) to connect to data sources that support it. The syntax employed in the connection string varies by provider. The following table shows the Windows Authentication syntax used with the .NET Framework data providers.
4545

@@ -54,9 +54,13 @@ Each .NET Framework data provider has a `Connection` object that inherits from <
5454
> `Integrated Security=true` throws an exception when used with the `OleDb` provider.
5555
5656
## SqlClient Connection Strings
57-
The syntax for a <xref:System.Data.SqlClient.SqlConnection> connection string is documented in the <xref:System.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> property. You can use the <xref:System.Data.SqlClient.SqlConnection.ConnectionString%2A> property to get or set a connection string for a SQL Server database. If you need to connect to an earlier version of SQL Server, you must use the .NET Framework Data Provider for OleDb (<xref:System.Data.OleDb>). Most connection string keywords also map to properties in the <xref:System.Data.SqlClient.SqlConnectionStringBuilder>.
58-
59-
Each of the following forms of syntax will use Windows Authentication to connect to the **AdventureWorks** database on a local server.
57+
The syntax for a <xref:System.Data.SqlClient.SqlConnection> connection string is documented in the <xref:System.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> property. You can use the <xref:System.Data.SqlClient.SqlConnection.ConnectionString%2A> property to get or set a connection string for a SQL Server database. If you need to connect to an earlier version of SQL Server, you must use the .NET Framework Data Provider for OleDb (<xref:System.Data.OleDb>). Most connection string keywords also map to properties in the <xref:System.Data.SqlClient.SqlConnectionStringBuilder>.
58+
59+
> [!IMPORTANT]
60+
> The default setting for the `Persist Security Info` keyword is `false`. Setting it to `true` or `yes` allows security-sensitive information, including the user ID and password, to be obtained from the connection after the connection has been opened. Keep `Persist Security Info` set to `false` to ensure that an untrusted source does not have access to sensitive connection string information.
61+
62+
### Windows authentication with SqlClient
63+
Each of the following forms of syntax uses Windows Authentication to connect to the **AdventureWorks** database on a local server.
6064

6165
```
6266
"Persist Security Info=False;Integrated Security=true;
@@ -67,26 +71,26 @@ Each .NET Framework data provider has a `Connection` object that inherits from <
6771
database=AdventureWorks;server=(local)"
6872
```
6973

70-
### SQL Server Logins
74+
### SQL Server authentication with SqlClient
7175
Windows Authentication is preferred for connecting to SQL Server. However, if SQL Server Authentication is required, use the following syntax to specify a user name and password. In this example, asterisks are used to represent a valid user name and password.
7276

7377
```
7478
"Persist Security Info=False;User ID=*****;Password=*****;Initial Catalog=AdventureWorks;Server=MySqlServer"
7579
```
76-
77-
> [!IMPORTANT]
78-
> The default setting for the `Persist Security Info` keyword is `false`. Setting it to `true` or `yes` allows security-sensitive information, including the user ID and password, to be obtained from the connection after the connection has been opened. Keep `Persist Security Info` set to `false` to ensure that an untrusted source does not have access to sensitive connection string information.
79-
80-
To connect to a named instance of SQL Server, use the *server name\instance name* syntax.
80+
81+
When you connect to Azure SQL Database or to Azure SQL Data Warehouse and provide a login in the format `user@servername`, make sure that the `servername` value in the login matches the value provided for `Server=`.
82+
83+
> [!NOTE]
84+
> Windows authentication takes precedence over SQL Server logins. If you specify both Integrated Security=true as well as a user name and password, the user name and password will be ignored and Windows authentication will be used.
85+
86+
### Connect to a named instance of SQL Server
87+
To connect to a named instance of SQL Server, use the *server name\instance name* syntax.
8188

8289
```
8390
Data Source=MySqlServer\MSSQL1;"
8491
```
85-
86-
You can also set the <xref:System.Data.SqlClient.SqlConnectionStringBuilder.DataSource%2A> property of the `SqlConnectionStringBuilder` to the instance name when building a connection string. The <xref:System.Data.SqlClient.SqlConnection.DataSource%2A> property of a <xref:System.Data.SqlClient.SqlConnection> object is read-only.
87-
88-
> [!NOTE]
89-
> Windows authentication takes precedence over SQL Server logins. If you specify both Integrated Security=true as well as a user name and password, the user name and password will be ignored and Windows authentication will be used.
92+
93+
You can also set the <xref:System.Data.SqlClient.SqlConnectionStringBuilder.DataSource%2A> property of the `SqlConnectionStringBuilder` to the instance name when building a connection string. The <xref:System.Data.SqlClient.SqlConnection.DataSource%2A> property of a <xref:System.Data.SqlClient.SqlConnection> object is read-only.
9094

9195
### Type System Version Changes
9296
The `Type System Version` keyword in a <xref:System.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> specifies the client-side representation of [!INCLUDE[ssNoVersion](../../../../includes/ssnoversion-md.md)] types. See <xref:System.Data.SqlClient.SqlConnection.ConnectionString%2A?displayProperty=nameWithType> for more information about the `Type System Version` keyword.

docs/framework/data/adonet/sql/filestream-data.md

Lines changed: 2 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ namespace FileStreamTest
157157
string path = reader.GetString(0);
158158
byte[] transactionContext = reader.GetSqlBytes(1).Buffer;
159159

160-
using (Stream fileStream = new SqlFileStream(path, transactionContext, FileAccess.Write, FileOptions.SequentialScan, allocationSize: 0))
160+
using (Stream fileStream = new SqlFileStream(path, transactionContext, FileAccess.ReadWrite, FileOptions.SequentialScan, allocationSize: 0))
161161
{
162162
// Seek to the end of the file
163163
fileStream.Seek(0, SeekOrigin.End);
@@ -172,42 +172,7 @@ namespace FileStreamTest
172172

173173
}
174174
}
175-
} using (SqlConnection connection = new SqlConnection(
176-
connStringBuilder.ToString()))
177-
{
178-
connection.Open();
179-
180-
SqlCommand command = new SqlCommand("", connection);
181-
command.CommandText = "select Top(1) Photo.PathName(), "
182-
+ "GET_FILESTREAM_TRANSACTION_CONTEXT () from employees";
183-
184-
SqlTransaction tran = connection.BeginTransaction(
185-
System.Data.IsolationLevel.ReadCommitted);
186-
command.Transaction = tran;
187-
188-
using (SqlDataReader reader = command.ExecuteReader())
189-
{
190-
while (reader.Read())
191-
{
192-
// Get the pointer for file
193-
string path = reader.GetString(0);
194-
byte[] transactionContext = reader.GetSqlBytes(1).Buffer;
195-
196-
FileStream fileStream = new SqlFileStream(path,
197-
(byte[])reader.GetValue(1),
198-
FileAccess.ReadWrite,
199-
FileOptions.SequentialScan, 0);
200-
201-
// Seek to the end of the file
202-
fs.Seek(0, SeekOrigin.End);
203-
204-
// Append a single byte
205-
fileStream.WriteByte(0x01);
206-
fileStream.Close();
207-
}
208-
}
209-
tran.Commit();
210-
}
175+
}
211176
```
212177

213178
For another sample, see [How to store and fetch binary data into a file stream column](http://www.codeproject.com/Articles/32216/How-to-store-and-fetch-binary-data-into-a-file-str).

docs/framework/reflection-and-codedom/reflection-and-generic-types.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -62,15 +62,15 @@ ms.workload:
6262

6363
<a name="is_this_a_generic_type_or_method"></a>
6464
## Is This a Generic Type or Method?
65-
When you use reflection to examine an unknown type, represented by an instance of <xref:System.Type>, use the <xref:System.Type.IsGenericType%2A> property to determine whether the unknown type is generic. It returns `true` if the type is generic. Similarly, when you examine an unknown method, represented by an instance of the <xref:System.Reflection.MethodInfo> class, use the <xref:System.Reflection.MethodInfo.IsGenericMethod%2A> property to determine whether the method is generic.
65+
When you use reflection to examine an unknown type, represented by an instance of <xref:System.Type>, use the <xref:System.Type.IsGenericType%2A> property to determine whether the unknown type is generic. It returns `true` if the type is generic. Similarly, when you examine an unknown method, represented by an instance of the <xref:System.Reflection.MethodInfo> class, use the <xref:System.Reflection.MethodBase.IsGenericMethod%2A> property to determine whether the method is generic.
6666

6767
### Is This a Generic Type or Method Definition?
68-
Use the <xref:System.Type.IsGenericTypeDefinition%2A> property to determine whether a <xref:System.Type> object represents a generic type definition, and use the <xref:System.Reflection.MethodInfo.IsGenericMethodDefinition%2A> method to determine whether a <xref:System.Reflection.MethodInfo> represents a generic method definition.
68+
Use the <xref:System.Type.IsGenericTypeDefinition%2A> property to determine whether a <xref:System.Type> object represents a generic type definition, and use the <xref:System.Reflection.MethodBase.IsGenericMethodDefinition%2A> method to determine whether a <xref:System.Reflection.MethodInfo> represents a generic method definition.
6969

7070
Generic type and method definitions are the templates from which instantiable types are created. Generic types in the .NET Framework class library, such as <xref:System.Collections.Generic.Dictionary%602>, are generic type definitions.
7171

7272
### Is the Type or Method Open or Closed?
73-
A generic type or method is closed if instantiable types have been substituted for all its type parameters, including all the type parameters of all enclosing types. You can only create an instance of a generic type if it is closed. The <xref:System.Type.ContainsGenericParameters%2A?displayProperty=nameWithType> property returns `true` if a type is open. For methods, the <xref:System.Reflection.MethodInfo.ContainsGenericParameters%2A?displayProperty=nameWithType> method performs the same function.
73+
A generic type or method is closed if instantiable types have been substituted for all its type parameters, including all the type parameters of all enclosing types. You can only create an instance of a generic type if it is closed. The <xref:System.Type.ContainsGenericParameters%2A?displayProperty=nameWithType> property returns `true` if a type is open. For methods, the <xref:System.Reflection.MethodBase.ContainsGenericParameters%2A?displayProperty=nameWithType> method performs the same function.
7474

7575
[Back to top](#top)
7676

@@ -146,7 +146,7 @@ generic<typename V, typename W> ref class D : B<int, V> {};
146146
147147
<a name="invariants"></a>
148148
## Invariants
149-
For a table of the invariant conditions for common terms in reflection for generic types, see <xref:System.Type.IsGenericType%2A?displayProperty=nameWithType>. For additional terms relating to generic methods, see <xref:System.Reflection.MethodInfo.IsGenericMethod%2A?displayProperty=nameWithType>.
149+
For a table of the invariant conditions for common terms in reflection for generic types, see <xref:System.Type.IsGenericType%2A?displayProperty=nameWithType>. For additional terms relating to generic methods, see <xref:System.Reflection.MethodBase.IsGenericMethod%2A?displayProperty=nameWithType>.
150150
151151
[Back to top](#top)
152152

0 commit comments

Comments
 (0)