Example #1
0
        // List out all the collections we have loaded
        public void HandleListRequest(ApiRequest request)
        {
            dynamic output = new List <dynamic>();

            _libraryModel.GetBookCollections().ForEach(c =>
            {
                Debug.WriteLine($"collection: {c.Name}-->{c.PathToDirectory}");
                output.Add(
                    new
                {
                    id   = c.PathToDirectory,
                    name = c.Name
                });
            });
            request.ReplyWithJson(JsonConvert.SerializeObject(output));
        }