public void Refresh <T>(T source) where T : class { if (null != source) { _service.Refresh(System.Data.Objects.RefreshMode.StoreWins, source); } }
public bool SaveChanges(System.Data.Objects.ObjectContext dataContext) { if (dataContext != null && this.TowarGuid != Guid.Empty) { if (this.EntityState == System.Data.EntityState.Detached) { dataContext.AddObject("Magazyn_StanyMagazynowe", this); } dataContext.SaveChanges(); dataContext.Refresh(System.Data.Objects.RefreshMode.StoreWins, this); return(true); } if (this.EntityState == System.Data.EntityState.Added) { dataContext.DeleteObject(this); } return(false); }