You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ignite.apache.org by sb...@apache.org on 2017/10/09 14:51:23 UTC

[16/29] ignite git commit: IGNITE-5224 .NET: PadLeft and PadRight support in LINQ

IGNITE-5224 .NET: PadLeft and PadRight support in LINQ

This closes #2808


Project: http://git-wip-us.apache.org/repos/asf/ignite/repo
Commit: http://git-wip-us.apache.org/repos/asf/ignite/commit/e5c25b44
Tree: http://git-wip-us.apache.org/repos/asf/ignite/tree/e5c25b44
Diff: http://git-wip-us.apache.org/repos/asf/ignite/diff/e5c25b44

Branch: refs/heads/ignite-5937
Commit: e5c25b444ae605f0b76289f5c8466c850a26e344
Parents: 2410f07
Author: Alexey Popov <ta...@gmail.com>
Authored: Fri Oct 6 12:18:38 2017 +0300
Committer: Pavel Tupitsyn <pt...@apache.org>
Committed: Fri Oct 6 12:18:38 2017 +0300

----------------------------------------------------------------------
 .../Cache/Query/Linq/CacheLinqTest.Strings.cs                   | 5 +++++
 .../platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs   | 4 ++++
 2 files changed, 9 insertions(+)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ignite/blob/e5c25b44/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Strings.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Strings.cs b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Strings.cs
index 7457d0a..1139c4d 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Strings.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Core.Tests/Cache/Query/Linq/CacheLinqTest.Strings.cs
@@ -46,6 +46,11 @@ namespace Apache.Ignite.Core.Tests.Cache.Query.Linq
         {
             var strings = GetSecondPersonCache().AsCacheQueryable().Select(x => x.Value.Name);
 
+            CheckFunc(x => x.PadLeft(20), strings);
+            CheckFunc(x => x.PadLeft(20, 'l'), strings);
+            CheckFunc(x => x.PadRight(20), strings);
+            CheckFunc(x => x.PadRight(20, 'r'), strings);
+
             CheckFunc(x => x.ToLower(), strings);
             CheckFunc(x => x.ToUpper(), strings);
             CheckFunc(x => x.StartsWith("Person_9"), strings);

http://git-wip-us.apache.org/repos/asf/ignite/blob/e5c25b44/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
----------------------------------------------------------------------
diff --git a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
index 9446af3..8abf2a6 100644
--- a/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
+++ b/modules/platforms/dotnet/Apache.Ignite.Linq/Impl/MethodVisitor.cs
@@ -66,6 +66,10 @@ namespace Apache.Ignite.Linq.Impl
             GetParameterizedTrimMethod("TrimStart", "ltrim"),
             GetParameterizedTrimMethod("TrimEnd", "rtrim"),
             GetStringMethod("Replace", "replace", typeof(string), typeof(string)),
+            GetStringMethod("PadLeft", "lpad", typeof (int)),
+            GetStringMethod("PadLeft", "lpad", typeof (int), typeof (char)),
+            GetStringMethod("PadRight", "rpad", typeof (int)),
+            GetStringMethod("PadRight", "rpad", typeof (int), typeof (char)),
 
             GetMethod(typeof (Regex), "Replace", new[] {typeof (string), typeof (string), typeof (string)}, 
                 GetFunc("regexp_replace")),