Ejemplo n.º 1
0
        public static Task <IActionResult> ToCreatedAtRouteResult <TInput>(
            this IOutputPipe <TInput> pipe,
            string routeName,
            Func <TInput, object> routeValuesGenerator)
            where TInput : class
        {
            IPipe createdEntityResultPipe = new CreatedEntityResultPipe <TInput>(
                routeValuesGenerator, routeName, pipe);

            return(createdEntityResultPipe.Execute());
        }
Ejemplo n.º 2
0
        public static Task <IActionResult> ToCreatedAtRouteResult <TInput, TLookup>(
            this IOutputPipe <TInput> pipe,
            string routeName,
            Func <TLookup, object> routeValuesGenerator)
            where TInput : class
        {
            IPipe createdEntityResultPipe = new CreatedEntityResultPipe <TInput>(
                s =>
            {
                var storage = s.GetService <IScopedStorage <TLookup> >();
                return(routeValuesGenerator(storage.Value));
            },
                routeName,
                pipe);

            return(createdEntityResultPipe.Execute());
        }