Example #1
0
        public static IOwinResponse WithODataEntityResponseBody(this IOwinResponse owinResponse, string baseAddress,
                                                                string entitySetName, JObject response, params JProperty[] additionalProperties)
        {
            if (response == null)
            {
                return(owinResponse);
            }

            foreach (var additionalProperty in additionalProperties.Reverse())
            {
                response.AddFirst(additionalProperty);
            }

            response.AddOdataContext(baseAddress, entitySetName);

            owinResponse.Write(response.ToString());

            return(owinResponse);
        }