public static IEnumerable <PersonRegistrationKey> GetByCriteria(PartDataContext dataContext, SoegObjektType soegObject, params Guid[] personRegistrationIds)
        {
            var elements = PersonRegistration.CreateXQueryElements(soegObject);

            if (personRegistrationIds != null)
            {
                if (personRegistrationIds.Length == 0)
                {
                    return(new PersonRegistrationKey[0]);
                }
                else
                {
                    elements.Add(
                        new InWhereCondition()
                    {
                        ColumnName = "PersonRegistrationId",
                        Values     = personRegistrationIds.Select(
                            id => id.ToString()
                            ).ToArray()
                    });
                }
            }
            var byCriteria = WhereCondition.GetMatchingObjects <PersonRegistrationKey>(dataContext, elements, "PersonRegistration", new string[] { "PersonRegistrationId", "UUID" });

            return(byCriteria);
        }
Esempio n. 2
0
        public static IEnumerable <Guid> GetUuidsByCriteria(PartDataContext dataContext, SoegObjektType soegObject, int startIndex, int maxCount)
        {
            var elements = PersonRegistration.CreateXQueryElements(soegObject);

#if Mono
            var byCriteriaStr = WhereCondition.GetMatchingObjects <object>(dataContext, elements, "PersonRegistration", true, new string[] { "UUID" }, startIndex, maxCount, "UUID");
            var byCriteria    = byCriteriaStr.Select(o => new Guid(o.ToString()));
#else
            var byCriteria = WhereCondition.GetMatchingObjects <Guid>(dataContext, elements, "PersonRegistration", true, new string[] { "UUID" }, startIndex, maxCount, "UUID");
#endif

            return(byCriteria);
        }