<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://customerfx.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Kris Halsrud&amp;#39;s Blog : IRepository, SalesLogix</title><link>http://customerfx.com/pages/integrationblog/archive/tags/IRepository/SalesLogix/default.aspx</link><description>Tags: IRepository, SalesLogix</description><dc:language>en</dc:language><generator>CommunityServer 2007 SP2 (Build: 20611.960)</generator><item><title>Using IRepository and ICriteria when you have 3 Or conditions</title><link>http://customerfx.com/pages/integrationblog/2010/10/14/using-irepository-and-icriteria-when-you-have-3-or-conditions.aspx</link><pubDate>Thu, 14 Oct 2010 19:57:00 GMT</pubDate><guid isPermaLink="false">e15581aa-2787-4c59-a940-524c09f5d256:43873</guid><dc:creator>Kris Halsrud</dc:creator><slash:comments>0</slash:comments><wfw:commentRss xmlns:wfw="http://wellformedweb.org/CommentAPI/">http://customerfx.com/pages/integrationblog/rsscomments.aspx?PostID=43873</wfw:commentRss><comments>http://customerfx.com/pages/integrationblog/2010/10/14/using-irepository-and-icriteria-when-you-have-3-or-conditions.aspx#comments</comments><description>&lt;p&gt;&amp;nbsp;&lt;/p&gt;&lt;p&gt;I recently ran into a case where I had to query an Entity in SalesLogix to find records where a user was in any one of three fields.&amp;nbsp; ICriteria has an Or operand but that is for comparing only two fields.&amp;nbsp; So how do you do three?&amp;nbsp; With Disjunction.&amp;nbsp; Here is an example:&lt;/p&gt;       &lt;blockquote&gt;&lt;p&gt;&lt;font color="#0000ff"&gt;Sage.Platform.RepositoryHelper&amp;lt;Sage.Entity.Interfaces.IAccount&amp;gt; repository =   &lt;br /&gt;Sage.Platform.EntityFactory.GetRepositoryHelper&amp;lt;Sage.Entity.Interfaces.IAccount&amp;gt;();    &lt;br /&gt;Sage.Platform.Repository.ICriteria criteria = repository.CreateCriteria();    &lt;br /&gt;criteria.Add(repository.EF.Disjunction()    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Add(repository.EF.Eq(&amp;quot;CreateUser&amp;quot;, CurrentEntity.Id.ToString()))    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Add(repository.EF.Eq(&amp;quot;ModifyUser&amp;quot;, CurrentEntity.Id.ToString()))    &lt;br /&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; .Add(repository.EF.Eq(&amp;quot;AccountManagerId&amp;quot;, CurrentEntity.Id.ToString())));    &lt;br /&gt;System.Collections.Generic.IList&amp;lt;Sage.Entity.Interfaces.IAccount&amp;gt; accounts = criteria.List&amp;lt;Sage.Entity.Interfaces.IAccount&amp;gt;();    &lt;/font&gt;&lt;/p&gt;&lt;/blockquote&gt;&lt;img src="http://customerfx.com/aggbug.aspx?PostID=43873" width="1" height="1"&gt;</description><category domain="http://customerfx.com/pages/integrationblog/archive/tags/IRepository/default.aspx">IRepository</category><category domain="http://customerfx.com/pages/integrationblog/archive/tags/SalesLogix/default.aspx">SalesLogix</category><category domain="http://customerfx.com/pages/integrationblog/archive/tags/SalesLogix+7.5.1/default.aspx">SalesLogix 7.5.1</category><category domain="http://customerfx.com/pages/integrationblog/archive/tags/SalesLogix+7.5.2/default.aspx">SalesLogix 7.5.2</category><category domain="http://customerfx.com/pages/integrationblog/archive/tags/SalesLogix+7.5.3/default.aspx">SalesLogix 7.5.3</category></item></channel></rss>