Ejemplo n.º 1
0
        public OeEntryFactory CreateEntryFactory(IEdmEntitySet entitySet)
        {
            if (_entryFactoryFactory != null)
            {
                return(_entryFactoryFactory(entitySet, ParameterType));
            }

            OePropertyAccessor[] accessors = OePropertyAccessor.CreateFromType(ParameterType, entitySet);
            return(OeEntryFactory.CreateEntryFactory(entitySet, accessors));
        }
Ejemplo n.º 2
0
 public OeEntryFactory CreateEntryFactory(Type entityType, IEdmEntitySet entitySet, Type sourceType)
 {
     OePropertyAccessor[] accessors;
     if (_aggProperties.Count == 0)
     {
         accessors = OePropertyAccessor.CreateFromType(entityType, entitySet);
     }
     else
     {
         accessors = OePropertyAccessor.CreateFromTuple(sourceType, _aggProperties, 0);
     }
     return(OeEntryFactory.CreateEntryFactory(entitySet, accessors));
 }
Ejemplo n.º 3
0
 public OeEntryFactory CreateEntryFactory(Type entityType, IEdmEntitySet entitySet, Type sourceType)
 {
     OePropertyAccessor[] accessors;
     if (_aggProperties.Count == 0)
     {
         accessors = OePropertyAccessor.CreateFromType(entityType, entitySet);
     }
     else
     {
         int groupIndex = _aggProperties.FindIndex(a => a.IsGroup);
         accessors = OePropertyAccessor.CreateFromTuple(sourceType, _aggProperties, groupIndex);
     }
     return(OeEntryFactory.CreateEntryFactory(entitySet, accessors));
 }
Ejemplo n.º 4
0
        public OeQueryContext CreateQueryContext(ODataUri odataUri, OeMetadataLevel metadataLevel)
        {
            var importSegment = (OperationImportSegment)odataUri.Path.FirstSegment;
            IEdmEntitySet entitySet = OeOperationHelper.GetEntitySet(importSegment.OperationImports.Single());
            if (entitySet == null)
                return null;

            Type clrType = _edmModel.GetClrType(entitySet.EntityType());
            OePropertyAccessor[] accessors = OePropertyAccessor.CreateFromType(clrType, entitySet);

            Db.OeEntitySetAdapter entitySetAdapter = _dataAdapter.EntitySetAdapters.Find(entitySet);
            return new OeQueryContext(_edmModel, odataUri, null, false, 0, false, metadataLevel, entitySetAdapter)
            {
                EntryFactory = OeEntryFactory.CreateEntryFactory(entitySet, accessors),
            };
        }
Ejemplo n.º 5
0
        private OeEntryFactory CreateEntryFactory(OeExpressionBuilder expressionBuilder)
        {
            IEdmEntitySet entitySet;

            if (ODataUri.Path.LastSegment is OperationSegment)
            {
                entitySet = OeOperationHelper.GetEntitySet(ODataUri.Path);
                Type clrEntityType             = EdmModel.GetClrType(entitySet.EntityType());
                OePropertyAccessor[] accessors = OePropertyAccessor.CreateFromType(clrEntityType, entitySet);
                return(OeEntryFactory.CreateEntryFactory(entitySet, accessors));
            }

            entitySet = OeParseNavigationSegment.GetEntitySet(ParseNavigationSegments);
            if (entitySet == null)
            {
                entitySet = OeEdmClrHelper.GetEntitySet(EdmModel, EntitySetAdapter.EntitySetName);
            }

            return(expressionBuilder.CreateEntryFactory(entitySet));
        }