public void Save(Session session) { using (var stream = new FileStream($"{session.SessionUserId}.dat", FileMode.OpenOrCreate)) { var result = session.ToBytes(); stream.Write(result, 0, result.Length); } }