예제 #1
0
        public static ResourceManipulationOperation GetManipulationOperation(Bundle.EntryComponent entryComponent, ILocalhost localhost, ISearchService service = null)
        {
            searchService = service;
            Bundle.HTTPVerb method    = localhost.ExtrapolateMethod(entryComponent, null); //CCR: is key needed? Isn't method required?
            Key             key       = localhost.ExtractKey(entryComponent);
            var             searchUri = GetSearchUri(entryComponent, method);

            return(builders[method](entryComponent.Resource, key, service, searchUri != null? ParseQueryString(localhost, searchUri): null));
        }
예제 #2
0
        public static Interaction ToInteraction(this ILocalhost localhost, Bundle.BundleEntryComponent bundleEntry)
        {
            Key key = localhost.ExtractKey(bundleEntry);

            Bundle.HTTPVerb method = localhost.ExtrapolateMethod(bundleEntry, key);

            if (key != null)
            {
                return(Interaction.Create(method, key, bundleEntry.Resource));
            }
            else
            {
                return(Interaction.Create(method, bundleEntry.Resource));
            }
        }
예제 #3
0
        public static async Task <ResourceManipulationOperation> GetManipulationOperation(
            Bundle.EntryComponent entryComponent,
            ILocalhost localhost,
            ISearchService service = null)
        {
            var method    = localhost.ExtrapolateMethod(entryComponent, null); //CCR: is key needed? Isn't method required?
            var key       = localhost.ExtractKey(entryComponent);
            var searchUri = GetSearchUri(entryComponent, method);

            return(await _builders[method](
                       entryComponent.Resource,
                       key,
                       service,
                       searchUri != null ? ParseQueryString(localhost, searchUri) : null)
                   .ConfigureAwait(false));
        }