Exemple #1
0
        public TDvLinkEntity[] GetLinks <TDvLinkEntity>(string[] ids, bool includeDetails = true)
            where TDvLinkEntity : IDvLinkEntity, new()
        {
            var query = DataVaultQuery <TDvLinkEntity> .FilterLinksWithPKs(
                new Dictionary <Type, string[]>
            {
                { typeof(TDvEntity), ids },
            },
                includeDetails);

            return(DataVaultContext.ReadLinks <TDvLinkEntity>(query));
        }
Exemple #2
0
        public TDvLinkEntity GetLink <TDvLinkEntity, TLinkedDvEntity>(string id, string linkedEntityId)
            where TDvLinkEntity : IDvLinkEntity, new()
            where TLinkedDvEntity : IDvEntity, new()
        {
            var query = DataVaultQuery <TDvLinkEntity> .FilterLinksWithPKs(
                new Dictionary <Type, string[]>
            {
                { typeof(TDvEntity), new[] { id } },
                { typeof(TLinkedDvEntity), new[] { linkedEntityId } }
            });

            return(DataVaultContext.ReadLinks <TDvLinkEntity>(query).FirstOrDefault());
        }
Exemple #3
0
        public TDvLinkEntity[] GetLinks <TDvLinkEntity, TLinkedDvEntity>(string id, string[] linkedEntityIds)
            where TDvLinkEntity : IDvLinkEntity, new()
            where TLinkedDvEntity : IDvEntity, new()
        {
            if (linkedEntityIds.IsNullOrEmpty())
            {
                return(Array.Empty <TDvLinkEntity>());
            }

            var query = DataVaultQuery <TDvLinkEntity> .FilterLinksWithPKs(
                new Dictionary <Type, string[]>
            {
                { typeof(TDvEntity), new[] { id } },
                { typeof(TLinkedDvEntity), linkedEntityIds }
            });

            return(DataVaultContext.ReadLinks <TDvLinkEntity>(query));
        }