Owin.Response.AddToBody C# (CSharp) Method

AddToBody() public method

Set the body to one or many objects, adding to any other values the body may have
public AddToBody ( ) : Response
return Response
        public Response AddToBody(params object[] objects)
        {
            IEnumerable<object> stuffToAdd = objects;
            if (objects.Length == 1 && objects[0] is IEnumerable<object>)
                stuffToAdd = objects[0] as IEnumerable<object>;

            List<object> allObjects = new List<object>(Body);
            allObjects.AddRange(stuffToAdd);
            Body = allObjects;
            return this;
        }