protected void Page_Load(object sender, EventArgs e) { var repository = new NorthwindWeb.Data.CategoryRepository((Context)Page.Items["context"]); _lazyItem = new Lazy<NorthwindWeb.Business.Category>(() => string.IsNullOrEmpty(idHiddenField.Value) ? null : repository.Read(Convert.ToInt32(idHiddenField.Value))); }