//commits repository to the db... private bool Commit() { //search non respository UI list for pending saved marked records and mark them as valid... bool forceRefresh = false; var items = (from q in WarehouseLocationList where q.IsValid == 2 select q).ToList(); foreach (WarehouseLocation item in items) { //if item is added then we will trigger a refresh to fetch the navigated properties... if (GetWarehouseLocationState(item) == EntityStates.Added) { forceRefresh = true; } item.IsValid = 0; item.NotValidMessage = null; } _serviceAgent.CommitWarehouseLocationRepository(); Dirty = false; AllowCommit = false; AllowKeyEntry = false; if (forceRefresh) { Refresh(); } return(true); }