Orm |
[Missing <param name="query"/> documentation for "M:SanteDB.OrmLite.OrmQueryResultSet`1.Union(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})"]
[Missing <returns> documentation for "M:SanteDB.OrmLite.OrmQueryResultSet`1.Union(System.Linq.Expressions.Expression{System.Func{`0,System.Boolean}})"]
This method returns a new IQueryResultSetTData which contains a UNION of results in the current set and a new set described by query.
The method used to load these results depends on the underlying persistence layer, however in SQL would be:
var results = repository.Find(o=>o.StatusConceptKey == StatusKeys.Active).AsResultSet();
results = results.Union(o=>o.StatusConceptKey == StatusKeys.New).Where(o => o.CreationTime > DateTimeOffset.Now);
In SQL based persistence services this results in a query similar to:
SELECT * FROM ( SELECT * FROM x WHERE sts_cd_id = 'ACTIVE_UUID' UNION SELECT * FROM x WHERE sts_cd_id = 'NEW_UUID' ) I WHERE crt_utc > CURRENT_TIMESTAMP;