コード例 #1
0
        public T First <T>(object primaryOf) where T : class
        {
            var query = new DocumentQuery(GetTypeOfName <T>());

            query.HasPrimaryOf = true;
            query.AddParameter(new QueryParameter
            {
                Type  = ParameterType.PrimaryOf,
                Field = DocumentDefaults.DocumentMetaPrimaryOfProperty,
                Value = primaryOf
            });

            return(Engine.Read <T>(query));
        }
コード例 #2
0
        public static DocumentQuery GetQueryOfFromPrimaryOf(this List <DocumentKey> keys, string typeOf)
        {
            var query = new DocumentQuery(typeOf);

            foreach (var key in keys)
            {
                query.AddParameter(new QueryParameter
                {
                    Type  = ParameterType.PrimaryOf,
                    Field = DocumentDefaults.DocumentMetaPrimaryOfProperty,
                    Value = key.PrimaryOf
                });
            }

            return(query);
        }