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

We need a way to test for space existance without exception #125

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

aensidhe
Copy link
Member

Implementing IReadOnlyDictionary seems to be reasonable choice, but question arises: what should we return in untyped Enumerator?

{
using (var tarantoolClient = await Client.Box.Connect(ConnectionStringFactory.GetReplicationSource_1_7()))
{
foreach (var pair in (IReadOnlyDictionary<string, ISpace>)tarantoolClient.Schema)
Copy link
Member Author

Choose a reason for hiding this comment

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

This will be pain in the ass, because you always forced to cast schema to exact interface.

{
using (var tarantoolClient = await Client.Box.Connect(ConnectionStringFactory.GetReplicationSource_1_7()))
{
foreach (var pair in (IReadOnlyDictionary<string, ISpace>)tarantoolClient.Schema)
Copy link
Contributor

Choose a reason for hiding this comment

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

How about exposing IndexByName and IndexById as IReadonlyDictionaries instead of decoration?

Copy link
Member Author

Choose a reason for hiding this comment

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

box.Schema.IndexByName ?

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, typo, should be:

  • Properties IndexByName and IndexById in Space
  • Properties SpaceByName and SpaceById in Schema

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.

None yet

2 participants