You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by vo...@apache.org on 2016/09/08 14:46:01 UTC
[19/50] ignite git commit: Implement Keys property
Implement Keys property
Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/3141a805
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/3141a805
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/3141a805
Branch: refs/heads/ignite-3199-1
Commit: 3141a805006c5b2a155e41a1cee8d113f63819a3
Parents: cce9a6a
Author: Pavel Tupitsyn <pt...@apache.org>
Authored: Mon Sep 5 18:54:25 2016 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Mon Sep 5 18:54:25 2016 +0300
----------------------------------------------------------------------
.../Impl/IgniteSessionStateItemCollection.cs | 23 +++++++++++++-------
1 file changed, 15 insertions(+), 8 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/ignite/blob/3141a805/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs b/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
index 545121a..5f46248 100644
--- a/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.AspNet/Impl/IgniteSessionStateItemCollection.cs
@@ -119,14 +119,7 @@ namespace Apache.Ignite.AspNet.Impl
/** <inheritdoc /> */
public NameObjectCollectionBase.KeysCollection Keys
{
- get
- {
- // TODO: Inherit NameObjectCollectionBase in this class!
- // We should do everything possible to be pluggable.
-
- // KeysCollection ctor is internal, not possible to return it.
- throw new NotSupportedException("Use GetEnumerator instead to get all entries.");
- }
+ get { return new NameObjectCollection(this).Keys; }
}
/** <inheritdoc /> */
@@ -135,5 +128,19 @@ namespace Apache.Ignite.AspNet.Impl
get { return _collection.IsDirty; }
set { _collection.IsDirty = value; }
}
+
+ /// <summary>
+ /// NameObjectCollectionBase.KeysCollection has internal constructor.
+ /// The only way to implement ISessionStateItemCollection.Keys property
+ /// is to have a NameObjectCollectionBase in hand.
+ /// </summary>
+ private class NameObjectCollection : NameObjectCollectionBase
+ {
+ public NameObjectCollection(IgniteSessionStateItemCollection col)
+ {
+ foreach (string key in col)
+ BaseAdd(key, null);
+ }
+ }
}
}
\ No newline at end of file