I have a LINQ β Class file with the name MoviesDB.dbml, I added one table βMovieβ to it, I created a class βMoviesβ in which I implemented all the methods.
The GetAllMovies method that gets the list, when linking the list, I get the following:
Type 'DyMvWebsite.Movie' in Assembly 'DyMvWebsite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' is not marked as serializable.
Code for the method:
public static List<Movie> GetAllMovies() { List<Movie> oMoviesList = new List<Movie>(); using (MoviesDBDataContext oMoviesDBDataContext = new MoviesDBDataContext()) { oMoviesList = oMoviesList.ToList<Movie>(); ; } return oMoviesList; }
After that, I tried to put the [Serializable] attribute in the Movies class and tried to put it in the linq constructor file, but the same problem.
Edit:
After what Massimiliano Peluso suggested, I got a new error:
Type 'System.Data.Linq.ChangeTracker+StandardChangeTracker' in Assembly 'System.Data.Linq, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' is not marked as serializable.
source share