public User(int id, bool isOk) { this.Id = id; //Articles = ArticleServices.GetArticesByID(id); //OneArtice = ArticleServices.GetAllArtices().Where(x => x.Id == id); OneArtice = ArticleServices.GetAllArtices(); Console.WriteLine("User Initializer 另一种延迟"); }
public User(int id) { this.Id = id; Articles = ArticleServices.GetArtices(); Console.WriteLine("User Initializer 未使用任何"); }
public User_lazy(int id) { this.Id = id; Articles = new Lazy <List <Article> >(() => ArticleServices.GetArtices()); Console.WriteLine("User_lazy Initializer"); }