public bool Delete(IGeekyObj geekyObjId) { var practice = _swimteamDb.Practices.Single(p => p.Id.Equals(geekyObjId.Id)); if (practice == null) { throw new Exception("No practice found to delete???"); } _swimteamDb.Practices.Remove(practice); var recordCount = _swimteamDb.SaveChanges(); return(recordCount > 0); }
public bool Update(IGeekyObj geekyObject) { Practice practice = (Practice)geekyObject; if (practice == null) { throw new Exception("No practice found to update???"); } _swimteamDb.Practices.Update(practice); var recordCount = _swimteamDb.SaveChanges(); return(recordCount > 0); }
public bool Create(IGeekyObj geekyObject) { GImage practice = (GImage)geekyObject; if (practice == null) { return(false); } _swimteamDb.Images.Add(practice); var recordCount = _swimteamDb.SaveChanges(); return(recordCount > 0); }