A return keyword must not be followed by a object expression Help

The object here is going to be a list of Artist, i want to return that back out onto the method that called it

public static void LoadData(object obj, string filename) { if(File.Exists(filename)) { XmlSerializer deserializer = new XmlSerializer(typeof(Artist)); TextReader textReader = new StreamReader(filename); Artist _object = (Artist)deserializer.Deserialize(textReader); textReader.Close();

 if(_object == null) { return _object; } else { return _object; } } 

by barcemo via /r/csharp

Leave a Reply