I am going through a tutorial on MVC - Linq to SQL. Here, I noticed they are using underscore in object names (first character in object name) such as "_dataContext"
Here is the code:
using System.Collections.Generic;
using System.Linq;
namespace MvcApplication1.Models
{
public class MovieRepository : IMovieRepository
{
private MovieDataContext _dataContext;
public MovieRepository()
{
_dataContext = new MovieDataContext();
}
#region IMovieRepository Members
public IList<Movie> ListAll()
{
var movies = from m in _dataContext.Movies
select m;
return movies.ToList();
}
#endregion
}
}
My questions is, what is the purpose of using this underscore?