public void Destroy(VersionsViewModel db) { var entity = new Versions_Table(); entity.VersionsID = db.VersionsID; entities.Versions_Table.Attach(entity); entities.Versions_Table.Remove(entity); entities.SaveChanges(); }
public void Create(VersionsViewModel db) { var entity = new Versions_Table(); entity.VersionsName = db.VersionsName; entity.VersionsDate = (DateTime)db.VersionsDate.Date; entity.PartnerName = db.PartnerName; entity.VersionsNumbers = db.VersionsNumbers; entity.TypesOfCopies = db.TypesOfCopies; entity.url = db.url; entity.UserID = db.UserID; entity.ProjectID = db.ProjectID; entities.Versions_Table.Add(entity); entities.SaveChanges(); db.VersionsID = entity.VersionsID; }
public void Update(VersionsViewModel db) { var entity = new Versions_Table(); entity.VersionsID = db.VersionsID; entity.VersionsName = db.VersionsName; entity.VersionsDate = (DateTime)db.VersionsDate.Date; entity.PartnerName = db.PartnerName; entity.VersionsNumbers = db.VersionsNumbers; entity.TypesOfCopies = db.TypesOfCopies; entity.url = db.url; entity.UserID = db.UserID; entity.ProjectID = db.ProjectID; entities.Versions_Table.Attach(entity); entities.Entry(entity).State = EntityState.Modified; entities.SaveChanges(); }