using System.Collections.Generic;
using WpfApp3.Class;
using System.IO;
using System.Linq;
using System.Globalization;
using System.Runtime.Serialization.Json;
namespace WpfApp3
{
        public class JSONDataProvider
        {
            private List<MusicalInstrument> _instruments;
            public JSONDataProvider()
            {
                var serializer = new DataContractJsonSerializer(typeof(MusicalInstrument[]));
                using (var sr = new StreamReader("data.json"))
                {
                    _instruments = ((MusicalInstrument[])serializer.ReadObject(sr.BaseStream)).ToList();
                }
            }
            public List<MusicalInstrument> GetInstruments()
            {
                return _instruments;
            }
        }
}