public Gear Save(Gear gear) { try { GearRepository.SaveOrUpdate(gear); GearRepository.DbContext.CommitChanges(); } catch (Exception e) { log.Error("Unable to save gear " + gear.Title, e); } return gear; }
public Gear Delete(Gear gear) { Gear retVal = new Gear(); try { GearRepository.Delete(gear); GearRepository.DbContext.CommitChanges(); } catch (Exception e) { log.Error("Cound not delete piece of gear " + gear.Title + ". A dive probably references this piece of gear"); throw e; } return retVal; }
public virtual bool Equals(Gear obj) { if (obj == null) return false; if (Equals(Acquired, obj.Acquired) == false) return false; //if (Equals(GearId, obj.GearId) == false) // return false; if (Equals(NoLongerUse, obj.NoLongerUse) == false) return false; if (Equals(Notes, obj.Notes) == false) return false; if (Equals(Paid, obj.Paid) == false) return false; if (Equals(RetailPrice, obj.RetailPrice) == false) return false; if (Equals(Sn, obj.Sn) == false) return false; if (Equals(Title, obj.Title) == false) return false; if (Equals(Weight, obj.Weight) == false) return false; if (Equals(Created, obj.Created) == false) return false; if (Equals(Created, obj.Created) == false) return false; return true; }