Skip to content

Help! Thousands of mappings & memory overload. #1015

Closed Answered by richardaubin
richardaubin asked this question in Q&A
Discussion options

You must be logged in to vote

I resolved the issue by creating an implementation of the IFileSystemHandler:

        public void WriteMappingFile(string path, string text)
        {
            var mappingModel = JsonConvert.DeserializeObject<MappingModel>(text)!;
            var filename = Path.Combine(Directory.GetCurrentDirectory(),@"__admin\files\",$"{mappingModel.Guid}.json");

            var bodyAsJson = mappingModel.Response.BodyAsJson!;
            File.WriteAllText(filename, bodyAsJson.ToString());

            mappingModel.Response.BodyAsJson = null;
            mappingModel.Response.BodyAsFile = filename;

            text = JsonConvert.SerializeObject(mappingModel);

            _fileSystemHandler.WriteMap…

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by richardaubin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
1 participant