public async Task PutAnchor(int productId, string name, AnchorPutRp model) { var createdBy = this._identityGateway.GetIdentity(); var entity = await this._dbContext.Anchors.Where(c => c.ProductId == productId && c.Name == name).SingleAsync(); this._dbContext.ChangeTracker.AutoDetectChangesEnabled = true; entity.Update(model.Target, this._datetimeGateway.GetCurrentDateTime(), createdBy); this._dbContext.Anchors.Update(entity); await this._dbContext.SaveChangesAsync(); }
public async Task <IActionResult> SetAnchor(int id, string name, [FromBody] AnchorPutRp model) { await this._productComponent.PutAnchor(id, name, model); return(this.Ok()); }