I have a class that posts data to a web API which then processes the large object and generates corresponding db records. I am dealing with a fairly large object that has multiple types of sub-objects in it. This is the code that I have:
var content = new StringContent(JsonConvert.SerializeObject(largeObject), Encoding.UTF8, "application/json");
var response = client.PostAsync(serviceEndpointURL,content).Result;
This returns SystemOutOfMemoryException understandably, but I am not sure how I can design this to support such large objects.