Пример #1
0
 public TDvHubEntity[] GetListByIds(string[] ids, bool includeDetails = true)
 {
     return(ids.IsNullOrEmpty()
         ? Array.Empty <TDvHubEntity>()
         : DataVaultContext.ReadRecords <TDvHubEntity>(
                new
     {
         filter = new[] { DataVaultQuery <TDvHubEntity> .ContainPKs(ids) },
         select = includeDetails ? new[] { "*" } : Array.Empty <object>(),
     }));
 }
Пример #2
0
        public TLinkedDvEntity[] GetLinkedEntities <TDvLinkEntity, TLinkedDvEntity>(string id, bool includeDetails = true)
            where TDvLinkEntity : IDvLinkEntity, new()
            where TLinkedDvEntity : IDvHubEntity, new()
        {
            var linkedEntitiesIds = GetLinkedEntityIds <TDvLinkEntity, TLinkedDvEntity>(id);

            return(linkedEntitiesIds.IsNullOrEmpty()
                ? Array.Empty <TLinkedDvEntity>()
                : DataVaultContext.ReadRecords <TLinkedDvEntity>(
                       new
            {
                filter = new[] { DataVaultQuery <TLinkedDvEntity> .ContainPKs(linkedEntitiesIds) },
                select = includeDetails ? new[] { "*" } : Array.Empty <object>(),
            }));
        }