/// <summary> /// Returns true if ReplaceOffer instances are equal /// </summary> /// <param name="other">Instance of ReplaceOffer to be compared</param> /// <returns>Boolean</returns> public bool Equals(ReplaceOffer other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return (( OfferType == other.OfferType || OfferType != null && OfferType.Equals(other.OfferType) ) && ( Resource == other.Resource || Resource != null && Resource.Equals(other.Resource) ) && ( OfferResourceId == other.OfferResourceId || OfferResourceId != null && OfferResourceId.Equals(other.OfferResourceId) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Rid == other.Rid || Rid != null && Rid.Equals(other.Rid) )); }
protected override async Task <bool> OnSave(OfferModel offer) { bool ok; if (Offer.type.Equals(_initialType)) { if (_initialType.Equals(OfferType.Can)) { ok = await CanService.UpdateCan(Offer); } else { ok = await WantService.UpdateWant(Offer); } } else { if (_initialType.Equals(OfferType.Can)) { ok = await CanService.DeleteCan(Offer.id); if (ok) { ok = await WantService.CreateWant(Offer); } } else { ok = await WantService.DeleteWant(Offer.id); if (ok) { ok = await CanService.CreateCan(Offer); } } } return(ok); }
/// <summary> /// Returns true if Offer instances are equal /// </summary> /// <param name="other">Instance of Offer to be compared</param> /// <returns>Boolean</returns> public bool Equals(Offer other) { // credit: http://stackoverflow.com/a/10454552/677735 if (other == null) { return(false); } return (( OfferType == other.OfferType || OfferType != null && OfferType.Equals(other.OfferType) ) && ( Resource == other.Resource || Resource != null && Resource.Equals(other.Resource) ) && ( OfferResourceId == other.OfferResourceId || OfferResourceId != null && OfferResourceId.Equals(other.OfferResourceId) ) && ( Id == other.Id || Id != null && Id.Equals(other.Id) ) && ( Rid == other.Rid || Rid != null && Rid.Equals(other.Rid) ) && ( Ts == other.Ts || Ts != null && Ts.Equals(other.Ts) ) && ( Self == other.Self || Self != null && Self.Equals(other.Self) ) && ( Etag == other.Etag || Etag != null && Etag.Equals(other.Etag) )); }