private void PutOneBuild(string slug, ApiRequest request) { var buffer = new byte[BufferSize]; var countBytes = ShortBodyReader.ReadBody(request.Body, buffer); var chars = Encoding.UTF8.GetChars(buffer, 0, countBytes); var json = new string(chars); var build = JsonSerializer.DeserializeString(json) as Hashtable; _configurationService.SaveBuildParams(slug, build); request.Client.Send200_OK("application/json"); }
private static void UnpackProject(ApiRequest request, ProjectModel proj) { var buffer = new byte[BufferSize]; var countBytes = ShortBodyReader.ReadBody(request.Body, buffer); var chars = Encoding.UTF8.GetChars(buffer, 0, countBytes); var json = new string(chars); var project = JsonSerializer.DeserializeString(json) as Hashtable; if (project == null) { return; } proj.Title = project["title"] as string; proj.Subtitle = project["subtitle"] as string; proj.Rank = Int32.Parse(project["rank"].ToString()); proj.Provider = (BuildServiceProvider)Int32.Parse(project["provider"].ToString()); }