//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 WarehouseLocationBinList where q.IsValid == 2 select q).ToList(); foreach (WarehouseLocationBin item in items) { //if item is added then we will trigger a refresh to fetch the navigated properties... if (GetWarehouseLocationBinState(item) == EntityStates.Added) { forceRefresh = true; } item.IsValid = 0; item.NotValidMessage = null; } _serviceAgent.CommitWarehouseLocationBinRepository(); Dirty = false; AllowCommit = false; AllowKeyEntry = false; if (forceRefresh) { Refresh(); } return(true); }