Hi
the following query
var activeStore = (from s in new XPQuery<BaseObjects.XpoDictionaryDifferenceStore>(session)
where s.Active && s.Aspect == str
select s).Take(1).FirstOrDefault();
return activeStore;
produces
Executing Sql 'select top 1 N0."Oid",N0."Aspect",N0."Active",N0."XmlContent",N0."OptimisticLockField",N0."GCRecord" from "dbo"."XpoDictionaryDifferenceStore" N0
where (N0."GCRecord" is null and N0."Active" and (N0."Aspect" = @p0))' with parameters '{(Default language)}' exception 'System.Data.SqlClient.SqlException: An expression of non-boolean type specified in a context where a condition is expected, near 'and'.
at System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection)
at System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj)
at System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj)
at System.Data.SqlClient.SqlDataReader.ConsumeMetaData()
at System.Data.SqlClient.SqlDataReader.get_MetaData()
at System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString)
at System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result)
at System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method)
at System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method)
at System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior)
at System.Data.Common.DbCommand.System.Data.IDbCommand.ExecuteReader(CommandBehavior behavior)
at DevExpress.Xpo.DB.ConnectionProviderSql.InternalGetData(IDbCommand command, CriteriaOperatorCollection targets, Int32 topClause)
at DevExpress.Xpo.DB.ConnectionProviderSql.SelectData(Query query, CriteriaOperatorCollection targets)'
but this one passes
var activeStore = (from s in new XPQuery<BaseObjects.XpoDictionaryDifferenceStore>(session)
where s.Active== true && s.Aspect == str
select s).Take(1).FirstOrDefault();
return activeStore;