File tree Expand file tree Collapse file tree
Orm/Xtensive.Orm.Tests/Storage Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- // Copyright (C) 2011-2021 Xtensive LLC.
1+ // Copyright (C) 2011-2024 Xtensive LLC.
22// This code is distributed under MIT license terms.
33// See the License.txt file in the project root for more information.
44// Created by: Denis Krjuchkov
@@ -164,6 +164,16 @@ public class ContainsOperatorSupport : TestBase
164164 public string TestField { get ; set ; }
165165 }
166166
167+ [ HierarchyRoot , Index ( nameof ( TestField ) , Filter = nameof ( Index ) ) ]
168+ public class ConditionalExpressionSuport : TestBase
169+ {
170+ public static Expression < Func < ConditionalExpressionSuport , bool > > Index =>
171+ test => test . Id == ( ( test . TestField == null ) ? 100 : 200 ) ? test . TestField . Contains ( "hello" ) : false ;
172+
173+ [ Field ]
174+ public string TestField { get ; set ; }
175+ }
176+
167177 [ HierarchyRoot ,
168178 Index ( nameof ( TestField ) , Filter = nameof ( More ) , Name = "MoreIndex" ) ,
169179 Index ( nameof ( TestField ) , Filter = nameof ( Less ) , Name = "LessIndex" ) ]
@@ -543,6 +553,9 @@ private void AssertBuildFailure(params Type[] entities)
543553 [ Test ]
544554 public void ContainsOperatorSupportTest ( ) => AssertBuildSuccess ( typeof ( ContainsOperatorSupport ) ) ;
545555
556+ [ Test ]
557+ public void ConditionalOperationSupportTest ( ) => AssertBuildSuccess ( typeof ( ConditionalExpressionSuport ) ) ;
558+
546559 [ Test ]
547560 public void DoubleIndexWithNameTest ( ) => AssertBuildSuccess ( typeof ( DoubleIndexWithName ) ) ;
548561
You can’t perform that action at this time.
0 commit comments