示例#1
0
        /// <summary>
        /// Gets the specified entities from the repository.
        /// </summary>
        /// <typeparam name="T">The type of entity to load.</typeparam>
        /// <param name="ids">The IDs of the entities to fetch.</param>
        /// <param name="preloadQuery">The network of relationships to preload.</param>
        public IReadOnlyCollection <T> Get <T>(IEnumerable <long> ids, string preloadQuery) where T : class, IEntity
        {
            BulkPreloader.Preload(new EntityRequests.EntityRequest(ids.Select(id => new EntityRef(id)), preloadQuery, "EntityRepository"));

            return(AsReadOnlyCollection(Entity.Get <T>(ids)));
        }
示例#2
0
 /// <summary>
 /// Gets the specified entity from the repository.
 /// </summary>
 /// <param name="alias">The ID of the entity to fetch.</param>
 /// <param name="preloadQuery">The network of relationships to preload.</param>
 /// <typeparam name="T">The type of entity to create.</typeparam>
 public T Get <T>(string alias, string preloadQuery) where T : class, IEntity
 {
     BulkPreloader.Preload(new EntityRequests.EntityRequest(new EntityRef(alias), preloadQuery, "EntityRepository"));
     return(Entity.Get <T>(alias));
 }
示例#3
0
 /// <summary>
 /// Gets the specified entity from the repository.
 /// </summary>
 /// <param name="id">The ID of the entity to fetch.</param>
 /// <param name="preloadQuery">The network of relationships to preload.</param>
 /// <typeparam name="T">The type of entity to create.</typeparam>
 public T Get <T>(long id, string preloadQuery) where T : class, IEntity
 {
     BulkPreloader.Preload(new EntityRequests.EntityRequest(new EntityRef(id), preloadQuery, "EntityRepository"));
     return(Entity.Get <T>(id));
 }
示例#4
0
 /// <summary>
 /// Gets the specified entity from the repository.
 /// </summary>
 /// <param name="alias">The ID of the entity to fetch.</param>
 /// <param name="preloadQuery">The network of relationships to preload.</param>
 public IEntity Get(string alias, string preloadQuery)
 {
     BulkPreloader.Preload(new EntityRequests.EntityRequest(new EntityRef(alias), preloadQuery, "EntityRepository"));
     return(Entity.Get(alias));
 }
示例#5
0
 /// <summary>
 /// Gets the specified entity from the repository.
 /// </summary>
 /// <param name="id">The ID of the entity to fetch.</param>
 /// <param name="preloadQuery">The network of relationships to preload.</param>
 public IEntity Get(long id, string preloadQuery)
 {
     BulkPreloader.Preload(new EntityRequests.EntityRequest(new EntityRef(id), preloadQuery, "EntityRepository"));
     return(Entity.Get(id));
 }