Skip to content

Commit 28797fc

Browse files
authored
update class library overview doc (#49636)
1 parent 4c33899 commit 28797fc

File tree

8 files changed

+179
-244
lines changed

8 files changed

+179
-244
lines changed

docs/csharp/fundamentals/types/index.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ C# provides a standard set of built-in types. These represent integers, floating
5454

5555
## Custom types
5656

57-
You use the [`struct`](../../language-reference/builtin-types/struct.md), [`class`](../../language-reference/keywords/class.md), [`interface`](../../language-reference/keywords/interface.md), [`enum`](../../language-reference/builtin-types/enum.md), and [`record`](../../language-reference/builtin-types/record.md) constructs to create your own custom types. The .NET class library itself is a collection of custom types that you can use in your own applications. By default, the most frequently used types in the class library are available in any C# program. Others become available only when you explicitly add a project reference to the assembly that defines them. After the compiler has a reference to the assembly, you can declare variables (and constants) of the types declared in that assembly in source code. For more information, see [.NET Class Library](../../../standard/class-library-overview.md).
57+
You use the [`struct`](../../language-reference/builtin-types/struct.md), [`class`](../../language-reference/keywords/class.md), [`interface`](../../language-reference/keywords/interface.md), [`enum`](../../language-reference/builtin-types/enum.md), and [`record`](../../language-reference/builtin-types/record.md) constructs to create your own custom types. The .NET class library itself is a collection of custom types that you can use in your own applications. By default, the most frequently used types in the class library are available in any C# program. Others become available only when you explicitly add a project reference to the assembly that defines them. After the compiler has a reference to the assembly, you can declare variables (and constants) of the types declared in that assembly in source code.
5858

5959
One of the first decisions you make when defining a type is deciding which construct to use for your type. The following list helps make that initial decision. There's overlap in the choices. In most scenarios, more than one option is a reasonable choice.
6060

@@ -82,14 +82,14 @@ The following illustration shows the relationship between value types and refere
8282
8383
Classes and structs are two of the basic constructs of the common type system in .NET. Each is essentially a data structure that encapsulates a set of data and behaviors that belong together as a logical unit. The data and behaviors are the *members* of the class, struct, or record. The members include its methods, properties, events, and so on, as listed later in this article.
8484

85-
A class, struct, or record declaration is like a blueprint that is used to create instances or objects at run time. If you define a class, struct, or record named `Person`, `Person` is the name of the type. If you declare and initialize a variable `p` of type `Person`, `p` is said to be an object or instance of `Person`. Multiple instances of the same `Person` type can be created, and each instance can have different values in its properties and fields.
86-
85+
A class, struct, or record declaration is like a blueprint that is used to create instances or objects at run time. If you define a class, struct, or record named `Person`, `Person` is the name of the type. If you declare and initialize a variable `p` of type `Person`, `p` is said to be an object or instance of `Person`. Multiple instances of the same `Person` type can be created, and each instance can have different values in its properties and fields.
86+
8787
A class is a reference type. When an object of the type is created, the variable to which the object is assigned holds only a reference to that memory. When the object reference is assigned to a new variable, the new variable refers to the original object. Changes made through one variable are reflected in the other variable because they both refer to the same data.
88-
88+
8989
A struct is a value type. When a struct is created, the variable to which the struct is assigned holds the struct's actual data. When the struct is assigned to a new variable, it's copied. The new variable and the original variable therefore contain two separate copies of the same data. Changes made to one copy don't affect the other copy.
9090

9191
Record types can be either reference types (`record class`) or value types (`record struct`). Record types contain methods that support value-equality.
92-
92+
9393
In general, classes are used to model more complex behavior. Classes typically store data that is intended to be modified after a class object is created. Structs are best suited for small data structures. Structs typically store data that isn't intended to be modified after the struct is created. Record types are data structures with extra compiler synthesized members. Records typically store data that isn't intended to be modified after the object is created.
9494

9595
### Value types

docs/framework/data/adonet/dataset-datatable-dataview/datatables.md

Lines changed: 47 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -6,53 +6,53 @@ ms.assetid: 52ff0e32-3e5a-41de-9a3b-7b04ea52b83e
66
---
77
# DataTables
88

9-
A <xref:System.Data.DataSet> is made up of a collection of tables, relationships, and constraints. In ADO.NET, <xref:System.Data.DataTable> objects are used to represent the tables in a **DataSet**. A **DataTable** represents one table of in-memory relational data; the data is local to the .NET-based application in which it resides, but can be populated from a data source such as Microsoft SQL Server using a **DataAdapter** For more information, see [Populating a DataSet from a DataAdapter](../populating-a-dataset-from-a-dataadapter.md).
10-
11-
The **DataTable** class is a member of the **System.Data** namespace within the .NET Framework class library. You can create and use a **DataTable** independently or as a member of a **DataSet**, and **DataTable** objects can also be used in conjunction with other .NET Framework objects, including the <xref:System.Data.DataView>. You access the collection of tables in a **DataSet** through the **Tables** property of the **DataSet** object.
12-
13-
The schema, or structure of a table is represented by columns and constraints. You define the schema of a **DataTable** using <xref:System.Data.DataColumn> objects as well as <xref:System.Data.ForeignKeyConstraint> and <xref:System.Data.UniqueConstraint> objects. The columns in a table can map to columns in a data source, contain calculated values from expressions, automatically increment their values, or contain primary key values.
14-
15-
In addition to a schema, a **DataTable** must also have rows to contain and order data. The <xref:System.Data.DataRow> class represents the actual data contained in a table. You use the **DataRow** and its properties and methods to retrieve, evaluate, and manipulate the data in a table. As you access and change the data within a row, the **DataRow** object maintains both its current and original state.
16-
17-
You can create parent-child relationships between tables using one or more related columns in the tables. You create a relationship between **DataTable** objects using a <xref:System.Data.DataRelation>. **DataRelation** objects can then be used to return the related child or parent rows of a particular row. For more information, see [Adding DataRelations](adding-datarelations.md).
18-
19-
## In This Section
20-
21-
[Creating a DataTable](creating-a-datatable.md)
22-
Explains how to create a **DataTable** and add it to a **DataSet**.
23-
24-
[DataTable Schema Definition](datatable-schema-definition.md)
25-
Provides information about creating and using **DataColumn** objects and constraints.
26-
27-
[Manipulating Data in a DataTable](manipulating-data-in-a-datatable.md)
28-
Explains how to add, modify, and delete data in a table. Explains how to use **DataTable** events to examine changes to data in the table.
29-
30-
[Handling DataTable Events](handling-datatable-events.md)
31-
Provides information about the events available for use with a **DataTable**, including events when column values are modified and rows are added or deleted.
32-
33-
## Related Sections
34-
35-
[ADO.NET](../index.md)
36-
Describes the ADO.NET architecture and components, and how to use them to access existing data sources and manage application data.
37-
38-
[DataSets, DataTables, and DataViews](index.md)
39-
Provides information about the ADO.NET **DataSet** including how to create relationships between tables.
40-
41-
<xref:System.Data.Constraint>
42-
Provides reference information about the **Constraint** object.
43-
44-
<xref:System.Data.DataColumn>
45-
Provides reference information about the **DataColumn** object.
46-
47-
<xref:System.Data.DataSet>
48-
Provides reference information about the **DataSet** object.
49-
50-
<xref:System.Data.DataTable>
51-
Provides reference information about the **DataTable** object.
52-
53-
[Class Library Overview](../../../../standard/class-library-overview.md)
54-
Provides an overview of the .NET Framework class library, including the **System** namespace as well as its second-level namespace, **System.Data**.
55-
9+
A <xref:System.Data.DataSet> is made up of a collection of tables, relationships, and constraints. In ADO.NET, <xref:System.Data.DataTable> objects are used to represent the tables in a **DataSet**. A **DataTable** represents one table of in-memory relational data; the data is local to the .NET-based application in which it resides, but can be populated from a data source such as Microsoft SQL Server using a **DataAdapter** For more information, see [Populating a DataSet from a DataAdapter](../populating-a-dataset-from-a-dataadapter.md).
10+
11+
The **DataTable** class is a member of the **System.Data** namespace within the .NET Framework class library. You can create and use a **DataTable** independently or as a member of a **DataSet**, and **DataTable** objects can also be used in conjunction with other .NET Framework objects, including the <xref:System.Data.DataView>. You access the collection of tables in a **DataSet** through the **Tables** property of the **DataSet** object.
12+
13+
The schema, or structure of a table is represented by columns and constraints. You define the schema of a **DataTable** using <xref:System.Data.DataColumn> objects as well as <xref:System.Data.ForeignKeyConstraint> and <xref:System.Data.UniqueConstraint> objects. The columns in a table can map to columns in a data source, contain calculated values from expressions, automatically increment their values, or contain primary key values.
14+
15+
In addition to a schema, a **DataTable** must also have rows to contain and order data. The <xref:System.Data.DataRow> class represents the actual data contained in a table. You use the **DataRow** and its properties and methods to retrieve, evaluate, and manipulate the data in a table. As you access and change the data within a row, the **DataRow** object maintains both its current and original state.
16+
17+
You can create parent-child relationships between tables using one or more related columns in the tables. You create a relationship between **DataTable** objects using a <xref:System.Data.DataRelation>. **DataRelation** objects can then be used to return the related child or parent rows of a particular row. For more information, see [Adding DataRelations](adding-datarelations.md).
18+
19+
## In This Section
20+
21+
[Creating a DataTable](creating-a-datatable.md)
22+
Explains how to create a **DataTable** and add it to a **DataSet**.
23+
24+
[DataTable Schema Definition](datatable-schema-definition.md)
25+
Provides information about creating and using **DataColumn** objects and constraints.
26+
27+
[Manipulating Data in a DataTable](manipulating-data-in-a-datatable.md)
28+
Explains how to add, modify, and delete data in a table. Explains how to use **DataTable** events to examine changes to data in the table.
29+
30+
[Handling DataTable Events](handling-datatable-events.md)
31+
Provides information about the events available for use with a **DataTable**, including events when column values are modified and rows are added or deleted.
32+
33+
## Related Sections
34+
35+
[ADO.NET](../index.md)\
36+
Describes the ADO.NET architecture and components, and how to use them to access existing data sources and manage application data.
37+
38+
[DataSets, DataTables, and DataViews](index.md)\
39+
Provides information about the ADO.NET <xref:System.Data.DataSet> including how to create relationships between tables.
40+
41+
<xref:System.Data.Constraint>\
42+
Provides reference information about the **Constraint** object.
43+
44+
<xref:System.Data.DataColumn>\
45+
Provides reference information about the **DataColumn** object.
46+
47+
<xref:System.Data.DataSet>\
48+
Provides reference information about the **DataSet** object.
49+
50+
<xref:System.Data.DataTable>\
51+
Provides reference information about the **DataTable** object.
52+
53+
[Core .NET libraries overview](../../../../standard/class-library-overview.md)\
54+
Provides an overview of the .NET class library.
55+
5656
## See also
5757

5858
- [ADO.NET Overview](../ado-net-overview.md)

0 commit comments

Comments
 (0)