예제 #1
0
        ///// <summary>
        ///// Namespace for internal EDM annotations.
        ///// </summary>
        //internal const string EdmInternalAnnotationNamespace = "http://schemas.microsoft.com/ado/2011/04/edm/internal";
        ///// <summary>
        ///// Ugly hack for an odata annotation name.
        ///// </summary>
        //private static readonly string s_clrTypeAnnotationLocalName = typeof(ClrTypeAnnotation).ToString().Replace(".", "_");

        private IEdmModel FixupEfEdmModel(TDbContext dbContext)
        {
            var edmModel = new FixedEfEdmModel(dbContext, _entityTypes);

            //var edmModel = dbContext.GetEdmModel();
            return(edmModel);

            //// Add ClrTypeAnnotation for each EntityType - needed by Web API OData
            //foreach (IEdmEntityType edmEntityType in edmModel.SchemaElements.OfType<IEdmEntityType>())
            //{
            //	var entityTypeMetadata = this.GetEntityType(edmEntityType);
            //	if (entityTypeMetadata != null)
            //	{
            //		edmModel.DirectValueAnnotationsManager.SetAnnotationValue(edmEntityType,
            //																  EdmInternalAnnotationNamespace,
            //																  s_clrTypeAnnotationLocalName,
            //																  new ClrTypeAnnotation(entityTypeMetadata.ClrType));
            //	}
            //}


            //var odataModelBuilder = new EfODataModelBuilder();
            //odataModelBuilder.ConfigureFrom(this);
            //return odataModelBuilder.GetEdmModel();
        }
예제 #2
0
            internal DirectValueAnnotationsManagerWrapper(IEdmDirectValueAnnotationsManager innerAnnotationsManager, FixedEfEdmModel parent)
            {
                Contract.Requires <ArgumentNullException>(innerAnnotationsManager != null);
                Contract.Requires <ArgumentNullException>(parent != null);

                _innerAnnotationsManager = innerAnnotationsManager;
                _parent = parent;
            }