Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update tracking.md #4298

Merged
merged 9 commits into from
Apr 5, 2023
Merged

Update tracking.md #4298

merged 9 commits into from
Apr 5, 2023

Conversation

Rick-Anderson
Copy link
Contributor

@Rick-Anderson Rick-Anderson commented Mar 28, 2023

Per MS style guide

  • Avoid future tense
  • drop () from methods

Use bigger ideas, fewer words : Our modern design hinges on crisp minimalism. Shorter is always better.
Short sentences and fragments are easier to scan and read. Prune every excess word.

Contributes to dotnet/AspNetCore.Docs#23572

@Rick-Anderson Rick-Anderson requested review from smitpatel and roji March 28, 2023 01:04
Copy link
Member

@roji roji left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM but will let @ajcvickers approve as well.

Re changing 2nd-person ("you can do this") to impersonal ("this can be done"), I thought a more personal tone was OK/encouraged, we certainly use 2nd-person in many places in our docs.

entity-framework/core/querying/tracking.md Outdated Show resolved Hide resolved
entity-framework/core/querying/tracking.md Outdated Show resolved Hide resolved

You can combine both of the above behaviors in same query. That is, you can have a no tracking query, which will do identity resolution in the results. Just like `AsNoTracking()` queryable operator, we've added another operator `AsNoTrackingWithIdentityResolution()`. There's also associated entry added in the <xref:Microsoft.EntityFrameworkCore.QueryTrackingBehavior> enum. When you configure the query to use identity resolution with no tracking, we use a stand-alone change tracker in the background when generating query results so each instance is materialized only once. Since this change tracker is different from the one in the context, the results are not tracked by the context. After the query is enumerated fully, the change tracker goes out of scope and garbage collected as required.
Tracking and no-tracking can be combined in the same query. That is, you can have a no-tracking query, which does identity resolution in the results. Just like `AsNoTracking` queryable operator, we've added another operator <xref:Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.AsNoTrackingWithIdentityResolution%60%601(System.Linq.IQueryable{%60%600})>. There's also associated entry added in the <xref:Microsoft.EntityFrameworkCore.QueryTrackingBehavior> enum. When the query to use identity resolution is configured with no tracking, a stand-alone change tracker is used in the background when generating query results so each instance is materialized only once. Since this change tracker is different from the one in the context, the results are not tracked by the context. After the query is enumerated fully, the change tracker goes out of scope and garbage collected as required.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to make other method names (AsNoTracking, AsTracking) xref links as well

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We probably want to make other method names (AsNoTracking, AsTracking) xref links as well

@roji please review this commit

@Rick-Anderson
Copy link
Contributor Author

LGTM but will let @ajcvickers approve as well.

Re changing 2nd-person ("you can do this") to impersonal ("this can be done"), I thought a more personal tone was OK/encouraged, we certainly use 2nd-person in many places in our docs.

Dan Roth had us use the more formal language when we started doc'ing ASP.NET Core. My strongest justification is the style guide mantra Shorter is always better. When a consultant is reading our docs to make recommendations to their client, your app, your code doesn't make sense. The shorter version always makes sense.


> [!NOTE]
> [Keyless entity types](xref:core/modeling/keyless-entity-types) are never tracked. Wherever this article mentions entity types, it refers to entity types which have a key defined.

> [!TIP]
> You can view this article's [sample](https://github.com/dotnet/EntityFramework.Docs/tree/main/samples/core/Querying/Tracking) on GitHub.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IMAO, too much bling can be distracting. I can revert.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, please.

Copy link
Contributor

@ajcvickers ajcvickers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

PR not passing checks.

@Rick-Anderson
Copy link
Contributor Author

PR not passing checks.

Nothing to do with my changes

Error: entity-framework/core/querying/tracking.md:82:1 MD004/ul-style Unordered list style [Expected: asterisk; Actual: dash]

I'll fix these.

Error: entity-framework/core/querying/tracking.md:82:1 MD004/ul-style Unordered list style [Expected: asterisk; Actual: dash]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants