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

Debug view for the state manager #19110

Merged
merged 1 commit into from
Dec 1, 2019
Merged

Debug view for the state manager #19110

merged 1 commit into from
Dec 1, 2019

Conversation

ajcvickers
Copy link
Member

To make it easy to view which entities are being tracked together their states and relationships.

Fixes #19109

Example short view:

RequiredAk1 {Id: 1} Unchanged AK {AlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342} AK {Id: 1, AlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342} FK {ParentId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
RequiredAk1 {Id: 2} Unchanged AK {AlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83} AK {Id: 2, AlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83} FK {ParentId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
RequiredAk2 {Id: 1} Unchanged FK {ParentId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredAk2 {Id: 2} Unchanged FK {ParentId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredAk2 {Id: 3} Unchanged FK {ParentId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredAk2 {Id: 4} Unchanged FK {ParentId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredComposite2 {Id: 1} Unchanged FK {ParentId: 2, ParentAlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredComposite2 {Id: 2} Unchanged FK {ParentId: 2, ParentAlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredComposite2 {Id: 3} Unchanged FK {ParentId: 1, ParentAlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredComposite2 {Id: 4} Unchanged FK {ParentId: 1, ParentAlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredSingleAk1 {Id: 1} Unchanged AK {AlternateId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83} AK {Id: 1, AlternateId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83} FK {RootId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
RequiredSingleAk2 {Id: 1} Unchanged FK {BackId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83}
RequiredSingleComposite2 {Id: 1} Unchanged FK {BackId: 1, BackAlternateId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83}
Root {Id: 1} Unchanged AK {AlternateId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}

Example long view:

RequiredAk1 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: '4a6e80c4-c494-405f-8272-6c5d9563867c' AK
  Discriminator: 'RequiredAk1'
  ParentId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' FK
  Children: [{Id: 1}, {Id: 2}]
  CompositeChildren: [{Id: 3}, {Id: 4}]
  Parent: {Id: 1}
RequiredAk1 {Id: 2} Unchanged
  Id: 2 PK
  AlternateId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' AK
  Discriminator: 'RequiredAk1'
  ParentId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' FK
  Children: [{Id: 3}, {Id: 4}]
  CompositeChildren: [{Id: 1}, {Id: 2}]
  Parent: {Id: 1}
RequiredAk2 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: 'a061bcf7-9ad5-4888-992c-be0a8038d14c'
  Discriminator: 'RequiredAk2'
  ParentId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  Parent: {Id: 1}
RequiredAk2 {Id: 2} Unchanged
  Id: 2 PK
  AlternateId: '07fa89a6-ef37-40b4-a637-ad237ac611b7'
  Discriminator: 'RequiredAk2'
  ParentId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  Parent: {Id: 1}
RequiredAk2 {Id: 3} Unchanged
  Id: 3 PK
  AlternateId: 'a8f55ccc-fd55-404c-8823-0a99775a9280'
  Discriminator: 'RequiredAk2'
  ParentId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  Parent: {Id: 2}
RequiredAk2 {Id: 4} Unchanged
  Id: 4 PK
  AlternateId: '5100ab11-ae7d-47d7-b8f6-c652ce53f1b2'
  Discriminator: 'RequiredAk2'
  ParentId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  Parent: {Id: 2}
RequiredComposite2 {Id: 1} Unchanged
  Id: 1 PK
  ParentAlternateId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  ParentId: 2 FK
  Parent: {Id: 2}
RequiredComposite2 {Id: 2} Unchanged
  Id: 2 PK
  ParentAlternateId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  ParentId: 2 FK
  Parent: {Id: 2}
RequiredComposite2 {Id: 3} Unchanged
  Id: 3 PK
  ParentAlternateId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  ParentId: 1 FK
  Parent: {Id: 1}
RequiredComposite2 {Id: 4} Unchanged
  Id: 4 PK
  ParentAlternateId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  ParentId: 1 FK
  Parent: {Id: 1}
RequiredSingleAk1 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: '9c87b4b4-d77d-4f4d-b043-e98d59f0ab74' AK
  RootId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' FK
  Root: {Id: 1}
  Single: {Id: 1}
  SingleComposite: {Id: 1}
RequiredSingleAk2 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: 'ff4d43e7-cbc9-489a-87eb-aee0f87d5b1e'
  BackId: '9c87b4b4-d77d-4f4d-b043-e98d59f0ab74' FK
  Back: {Id: 1}
RequiredSingleComposite2 {Id: 1} Unchanged
  Id: 1 PK
  BackAlternateId: '9c87b4b4-d77d-4f4d-b043-e98d59f0ab74' FK
  BackId: 1 FK
  Back: {Id: 1}
Root {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' AK
  OptionalChildren: []
  OptionalChildrenAk: []
  OptionalSingle: <null>
  OptionalSingleAk: <null>
  OptionalSingleAkDerived: <null>
  OptionalSingleAkMoreDerived: <null>
  OptionalSingleDerived: <null>
  OptionalSingleMoreDerived: <null>
  RequiredChildren: []
  RequiredChildrenAk: [{Id: 1}, {Id: 2}]
  RequiredCompositeChildren: []
  RequiredNonPkSingle: <null>
  RequiredNonPkSingleAk: <null>
  RequiredNonPkSingleAkDerived: <null>
  RequiredNonPkSingleAkMoreDerived: <null>
  RequiredNonPkSingleDerived: <null>
  RequiredNonPkSingleMoreDerived: <null>
  RequiredSingle: <null>
  RequiredSingleAk: {Id: 1}

To make it easy to view which entities are being tracked together their states and relationships.

Fixes #19109

Example short view:

```
RequiredAk1 {Id: 1} Unchanged AK {AlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342} AK {Id: 1, AlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342} FK {ParentId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
RequiredAk1 {Id: 2} Unchanged AK {AlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83} AK {Id: 2, AlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83} FK {ParentId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
RequiredAk2 {Id: 1} Unchanged FK {ParentId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredAk2 {Id: 2} Unchanged FK {ParentId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredAk2 {Id: 3} Unchanged FK {ParentId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredAk2 {Id: 4} Unchanged FK {ParentId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredComposite2 {Id: 1} Unchanged FK {ParentId: 2, ParentAlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredComposite2 {Id: 2} Unchanged FK {ParentId: 2, ParentAlternateId: 665e179f-e4a9-4cd7-b746-ec275f411e83}
RequiredComposite2 {Id: 3} Unchanged FK {ParentId: 1, ParentAlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredComposite2 {Id: 4} Unchanged FK {ParentId: 1, ParentAlternateId: ed1c54e9-6e3d-47be-aa0c-3807a69d1342}
RequiredSingleAk1 {Id: 1} Unchanged AK {AlternateId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83} AK {Id: 1, AlternateId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83} FK {RootId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
RequiredSingleAk2 {Id: 1} Unchanged FK {BackId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83}
RequiredSingleComposite2 {Id: 1} Unchanged FK {BackId: 1, BackAlternateId: 427406f3-5f71-4b8f-8ed2-d6f3befedf83}
Root {Id: 1} Unchanged AK {AlternateId: a2de1382-93fc-4944-a0ab-d8ce3230c0f4}
```

Example long view:
```
RequiredAk1 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: '4a6e80c4-c494-405f-8272-6c5d9563867c' AK
  Discriminator: 'RequiredAk1'
  ParentId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' FK
  Children: [{Id: 1}, {Id: 2}]
  CompositeChildren: [{Id: 3}, {Id: 4}]
  Parent: {Id: 1}
RequiredAk1 {Id: 2} Unchanged
  Id: 2 PK
  AlternateId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' AK
  Discriminator: 'RequiredAk1'
  ParentId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' FK
  Children: [{Id: 3}, {Id: 4}]
  CompositeChildren: [{Id: 1}, {Id: 2}]
  Parent: {Id: 1}
RequiredAk2 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: 'a061bcf7-9ad5-4888-992c-be0a8038d14c'
  Discriminator: 'RequiredAk2'
  ParentId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  Parent: {Id: 1}
RequiredAk2 {Id: 2} Unchanged
  Id: 2 PK
  AlternateId: '07fa89a6-ef37-40b4-a637-ad237ac611b7'
  Discriminator: 'RequiredAk2'
  ParentId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  Parent: {Id: 1}
RequiredAk2 {Id: 3} Unchanged
  Id: 3 PK
  AlternateId: 'a8f55ccc-fd55-404c-8823-0a99775a9280'
  Discriminator: 'RequiredAk2'
  ParentId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  Parent: {Id: 2}
RequiredAk2 {Id: 4} Unchanged
  Id: 4 PK
  AlternateId: '5100ab11-ae7d-47d7-b8f6-c652ce53f1b2'
  Discriminator: 'RequiredAk2'
  ParentId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  Parent: {Id: 2}
RequiredComposite2 {Id: 1} Unchanged
  Id: 1 PK
  ParentAlternateId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  ParentId: 2 FK
  Parent: {Id: 2}
RequiredComposite2 {Id: 2} Unchanged
  Id: 2 PK
  ParentAlternateId: 'cd351cc3-5afe-4ecc-82b4-7550e6c0fee6' FK
  ParentId: 2 FK
  Parent: {Id: 2}
RequiredComposite2 {Id: 3} Unchanged
  Id: 3 PK
  ParentAlternateId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  ParentId: 1 FK
  Parent: {Id: 1}
RequiredComposite2 {Id: 4} Unchanged
  Id: 4 PK
  ParentAlternateId: '4a6e80c4-c494-405f-8272-6c5d9563867c' FK
  ParentId: 1 FK
  Parent: {Id: 1}
RequiredSingleAk1 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: '9c87b4b4-d77d-4f4d-b043-e98d59f0ab74' AK
  RootId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' FK
  Root: {Id: 1}
  Single: {Id: 1}
  SingleComposite: {Id: 1}
RequiredSingleAk2 {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: 'ff4d43e7-cbc9-489a-87eb-aee0f87d5b1e'
  BackId: '9c87b4b4-d77d-4f4d-b043-e98d59f0ab74' FK
  Back: {Id: 1}
RequiredSingleComposite2 {Id: 1} Unchanged
  Id: 1 PK
  BackAlternateId: '9c87b4b4-d77d-4f4d-b043-e98d59f0ab74' FK
  BackId: 1 FK
  Back: {Id: 1}
Root {Id: 1} Unchanged
  Id: 1 PK
  AlternateId: '6d6b7c31-8865-439a-b8e4-0b541e1c8142' AK
  OptionalChildren: []
  OptionalChildrenAk: []
  OptionalSingle: <null>
  OptionalSingleAk: <null>
  OptionalSingleAkDerived: <null>
  OptionalSingleAkMoreDerived: <null>
  OptionalSingleDerived: <null>
  OptionalSingleMoreDerived: <null>
  RequiredChildren: []
  RequiredChildrenAk: [{Id: 1}, {Id: 2}]
  RequiredCompositeChildren: []
  RequiredNonPkSingle: <null>
  RequiredNonPkSingleAk: <null>
  RequiredNonPkSingleAkDerived: <null>
  RequiredNonPkSingleAkMoreDerived: <null>
  RequiredNonPkSingleDerived: <null>
  RequiredNonPkSingleMoreDerived: <null>
  RequiredSingle: <null>
  RequiredSingleAk: {Id: 1}
```
@ajcvickers ajcvickers requested review from AndriySvyryd, smitpatel, bricelam, maumar and roji and removed request for AndriySvyryd and smitpatel November 28, 2019 19:27
Copy link
Member

@AndriySvyryd AndriySvyryd left a comment

Choose a reason for hiding this comment

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

This is starting to look like a fully-fledged feature

@ajcvickers ajcvickers merged commit ced15e9 into master Dec 1, 2019
@ajcvickers ajcvickers deleted the Aisha1127 branch December 1, 2019 00:56
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.

Implement debug view for state manager
2 participants