I have a class with some static lists. For demonstrative purposes I'll only show two:
public class Foo
{
public static readonly List<long> FirstList(EfEntities dbContext)
{
return dbContext.SomeTable.Where(x => x == 1).ToList();
}
public static readonly List<long> SecondList(EfEntities dbContext)
{
return dbContext.SomeTable.Where(x => x == 2).ToList();
}
}
I'm not a big fan of passing my database context to each and every static method. Do you have any suggestions on different approaches?