public LiveResponse CreateLiveResponse(LiveResponse liveResponse, string errorMessage, HttpStatusCode httpStatusCode) { liveResponse.errorMessage = errorMessage; liveResponse.httpStatusCode = httpStatusCode; return(liveResponse); }
public string SerializeResponse(LiveResponse liveResponse) { json = JsonConvert.SerializeObject( liveResponse, Newtonsoft.Json.Formatting.Indented, new JsonSerializerSettings() { NullValueHandling = NullValueHandling.Ignore, ReferenceLoopHandling = ReferenceLoopHandling.Ignore } ); return(json); }
public ActionResult <string> CreateLiveControllerResponse(LiveResponse liveResponse) { string json = liveResponseSerializer.SerializeResponse(liveResponse); switch (liveResponse.httpStatusCode) { case HttpStatusCode.BadRequest: return(BadRequest(json)); case HttpStatusCode.NotFound: return(NotFound(json)); default: return(Ok(json)); } }