For the complete documentation index, see llms.txt. This page is also available as Markdown.

Data Schemas

Understand schema controls on fields and navigation from user archives, browsing history, and topic auditing.

Data schema is the schema text passed to data access or data service, describing which members are included in this operation. The relationship definition comes from mapping, and the schema only selects the shape used this time; it is not another database structure.

User Archive Requires Site Information

Source: src/Features/Archiving/UserDataTemplateModelProvider.cs (excerpt; see source for context).

UserDataTemplateModelProvider.cs
var schema = $"*, {nameof(UserProfile.Site)}" + "{*}";

This true pattern selects the User's simple fields and expands the Site's simple fields. An asterisk alone does not automatically expand all navigation, nor does it automatically complete dependent fields of model computed properties. The archiving provider then packages the results as Users and gives them to user-list.xlsx, see spreadsheets and templates.

Browsing Historyexpand Topic

Source: src/Services/UserService.cs (excerpt; see source for context).

UserService.cs
public IEnumerable<History> GetHistories(uint userId, Paging paging = null)
{
	if(userId == 0)
		userId = this.Principal.Identity.GetIdentifier<uint>();

	return this.DataAccess.Select<History>(Condition.Equal(nameof(History.UserId), userId), $"*, {nameof(History.Thread)}" + "{*}", paging);
}

History.Thread relationships are connected by maps. Expand only if the list truly requires subject details; collections or deep relationships may increase query times and result size.

Write Mode Contains Associated Members

Source: src/Services/ThreadService.cs (excerpt; see source for context).

When ThreadService inserts a topic, it first confirms that the text exists, and then adds Post to writing mode. The audit action limits the Approved field of Post to prevent a status action from updating irrelevant text by the way.

Syntax Reference and Framework Use Cases

Grammar
meaning

Comma separated members

Select multiple fields or navigation

asterisk

Simple members that can be matched by the current layer

Exclamation mark plus member

Exclude members from current selection

Dotted path or curly brace

Select members along a mapping relationship

colon plus quantity

Collection navigation limit, not page number

Order members within parentheses

Specify the sorting of navigation results. A negative sign or tilde indicates reverse order.

Discussions There is no business fragment using navigation limits, and the relevant boundaries use the frames SchemaTest and SchemaParserTest as a reference. The root result set is paginated using Paging, see Query.

Permissions and Calculated Fields

Mode controls read shapes, not authorization rules. When asking the caller to exclude audit judgment fields such as Approved and CreatorId, the text cannot be visible by default; the result filter of Discussions uses shielding processing for this. Calculated members also do not automatically derive their required original fields, the schema should be qualified by the service.

Last updated