public static void SaveDiagramData(string diagramName, byte[] diagramData)
        {
            var storage     = new DiagramStorage();
            var diagramInfo = storage.DiagramData.FirstOrDefault(x => x.Name == diagramName);

            if (diagramInfo == null)
            {
                diagramInfo = new DiagramData()
                {
                    Name = diagramName
                };
                storage.DiagramData.Add(diagramInfo);
            }
            diagramInfo.Data = diagramData;
            storage.SaveChanges();
        }
        public static byte[] GetDiagramData(string diagramName)
        {
            var storage = new DiagramStorage();

            return(storage.DiagramData.FirstOrDefault(x => x.Name == diagramName).Data);
        }
        public static IEnumerable <string> GetDiagramNames()
        {
            var storage = new DiagramStorage();

            return(storage.DiagramData.Select(x => x.Name).ToList());
        }