コード例 #1
0
        // TODO: Find a way to make this easier in Fubu")]
        private static void addEndpointsFor(Type entityType, BehaviorGraph graph)
        {
            graph.AddActionFor("{0}/find/{{Id}}".ToFormat(entityType.Name.ToLower()), typeof(DomainEntityFinder<>), entityType)
                .UrlCategory.Category = Categories.FIND;

            var finderForwarder = typeof(EntityFinderForwarder<>).CloseAndBuildAs<IChainForwarder>(entityType);
            graph.AddForwarder(finderForwarder);

            graph.AddActionFor("{0}/editproperty".ToFormat(entityType.Name).ToLower(), typeof(IPropertyUpdater<>), entityType)
                .UrlCategory.Category = Categories.PROPERTY_EDIT;

            var propertyForwarder = typeof(PropertyUpdaterForwarder<>).CloseAndBuildAs<IChainForwarder>(entityType);
            graph.AddForwarder(propertyForwarder);
        }