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); }
//Add a new entity to the model public void Add <T>(T entity) where T : class { _service.AddObject(typeof(T).Name, entity); }