scm0sml
asked on
good use of my unit of work?
Hi,
I have the following page load method:
It calls the following method in my base class:
I'm just wondering is the best way to use my PublicUnitOfWork or should the base class function be creating its own.
Note in my page load I may want to use the publicunitofwork some more for other things...
I'd appreciate some input/feedback on this.
Thanks
I have the following page load method:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
using (var db = new PublicUnitOfWork())
{
DisplayPageCMS(litPageTitle, litMetaKeywords, litMetaDescription, litBodyText, db);
}
}
}
It calls the following method in my base class:
public void DisplayPageCMS(Literal litPageTitle,Literal litMetaKeywords ,Literal litMetaDescription,Literal litBodyText, PublicUnitOfWork db)
{
Page p = db.Pages.FindById(1);
//do some work to set the lit values of my meta tags etc
}
I'm just wondering is the best way to use my PublicUnitOfWork or should the base class function be creating its own.
Note in my page load I may want to use the publicunitofwork some more for other things...
I'd appreciate some input/feedback on this.
Thanks
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.