Possible error in ProjectTracker download for Using CSLA 4 MVC?

Possible error in ProjectTracker download for Using CSLA 4 MVC?

Old forum URL: forums.lhotka.net/forums/t/10414.aspx


correodemarques posted on Friday, June 03, 2011

Looking at ProjectResourceEdit.cs on the code download from Using CSLA 4 MVC, the method Child_Update looks like this:

    private void Child_Update(ProjectEdit project)
    {
      using (var ctx = ProjectTracker.Dal.DalFactory.GetManager())
      {
        var dal = ctx.GetProvider<ProjectTracker.Dal.IAssignmentDal>();
        using (BypassPropertyChecks)
        {
          var item = dal.Fetch(project.Id, ResourceId);
          item.Assigned = ReadProperty(AssignedProperty);
          item.RoleId = Role;
          dal.Update(item);
          TimeStamp = item.LastChanged;
        }
      }
    }

I can see a new Dto being fetched:

var item = dal.Fetch(project.Id, ResourceId);

And then the values from the BO are provided to the Dto. After that the Update method in the Dal is invoked.

What I don't see is the Dto object getting the TimeStamp value from the BO before the Update.

In the example the value of the LastChanged field on the Dto is the value obtained when the Dto was Fetched right before the Update. I believe that value should be the one in the Business Object which was read it when the Business Object was fetched and therefore represents the moment the user started to modify the values of the BO.

 

RockfordLhotka replied on Friday, June 03, 2011

Nice catch, thank you!

Copyright (c) Marimer LLC