/// <summary> /// Loads the supported, OData-specific serializable annotations into their in-memory representations. /// </summary> /// <param name="model">The <see cref="IEdmModel"/> containing the annotations.</param> /// <param name="entityType">The <see cref="IEdmEntityType"/> to process.</param> /// <param name="maxEntityPropertyMappingsPerType">The maximum number of entity mapping attributes to be found /// for an entity type (on the type itself and all its base types).</param> public static void LoadODataAnnotations(this IEdmModel model, IEdmEntityType entityType, int maxEntityPropertyMappingsPerType) { ExceptionUtils.CheckArgumentNotNull(model, "model"); ExceptionUtils.CheckArgumentNotNull(entityType, "entityType"); // PERF: should we be smarter and only update existing annotations as needed (and only drop the caches if needed)? // remove any existing in-memory EPM annotations and EPM caches on the entity type model.ClearInMemoryEpmAnnotations(entityType); // NOTE: EnsureEpmCache will load the serializable EPM annotations if no in-memory annotations exist. model.EnsureEpmCache(entityType, maxEntityPropertyMappingsPerType); }
public static void LoadODataAnnotations(this IEdmModel model, IEdmEntityType entityType, int maxEntityPropertyMappingsPerType) { ExceptionUtils.CheckArgumentNotNull<IEdmModel>(model, "model"); ExceptionUtils.CheckArgumentNotNull<IEdmEntityType>(entityType, "entityType"); model.ClearInMemoryEpmAnnotations(entityType); model.EnsureEpmCache(entityType, maxEntityPropertyMappingsPerType); }