예제 #1
0
        public static IEnumerable <T> GenerateEntityReferenceList <T>(IEntityDataManager entityDataManager, IEnumerable <Guid> ids)
            where T : IEntityReference
        {
            List <T> result = new List <T>();

            foreach (Guid id in ids)
            {
                string entityType = entityDataManager.GetEntityType(id);

                Type type = Utility.GetMatchingEntityReferenceType <T>(entityType);
                T    r    = (T)Activator.CreateInstance(type);
                r.Id = id;

                result.Add(r);
            }

            return(result);
        }
예제 #2
0
 public static object GenerateEntityReferenceListGeneric(Type genericTypeParameter, IEntityDataManager entityDataManager, IEnumerable <Guid> ids)
 {
     return(Gnosis.Reflection.Utility.InvokeGenericStaticMethod(typeof(Utility), "GenerateEntityReferenceList", genericTypeParameter, entityDataManager, ids));
 }
예제 #3
0
 public static object GenerateEntityReferenceListGeneric(EntityField ef, IEntityDataManager entityDataManager, IEnumerable <Guid> ids)
 {
     return(GenerateEntityReferenceListGeneric(ef.PropertyFirstGenericTypeArgument, entityDataManager, ids));
 }
예제 #4
0
 public static IEnumerable <T> GenerateEntityList <T>(IEntityDataManager entityDataManager, IEnumerable <Guid> ids, IEnumerable <EntityField> fields)
     where T : IEntity
 {
     return(entityDataManager.LoadEntities <T>(ids, fields, new EntityField[] {}));
 }
예제 #5
0
 protected void SetEntityDataManager(IEntityDataManager entityDataManager)
 {
     this.entityDataManager = entityDataManager;
 }
예제 #6
0
 public EntityManager(IEntityDataManager entityDataManager)
 {
     SetEntityDataManager(entityDataManager);
 }