public static void RegisterInContainer(Action <Type, object> register, EdmModel model, GlobalFilters filters = null) #endregion { Guard.AgainstNull(nameof(register), register); Guard.AgainstNull(nameof(model), model); Scalars.RegisterInContainer(register); ArgumentGraphs.RegisterInContainer(register); if (filters == null) { filters = new GlobalFilters(); } var service = new EntityGraphAdapter(model, filters); register(typeof(IEntityGraphAdapter), service); }
public EntityGraphAdapter(EdmModel model, GlobalFilters filters) { // Guard.AgainstNull(nameof(model), model); this.filters = filters; includeAppender = new IncludeAppender(NavigationReader.GetNavigationProperties(model)); }
public static void RegisterInContainer(IUnityContainer container, EdmModel model, GlobalFilters filters = null) #endregion { Guard.AgainstNull(nameof(container), container); Guard.AgainstNull(nameof(model), model); container.RegisterType(typeof(ConnectionType <>), new TransientLifetimeManager()); container.RegisterType(typeof(EdgeType <>), new TransientLifetimeManager()); container.RegisterSingleton <PageInfoType>(); RegisterInContainer((type, instance) => { container.RegisterInstance(type, instance); }, model, filters); }