By Nick

2020-01-14 13:19:43 8 Comments

I am changing some fields in response object in IActionFilter:

public async void OnActionExecuted(ActionExecutedContext context)
    ObjectResult actionResult = (ObjectResult)context.Result;
    IHavePrice havePrice = Cast<IHavePrice>(actionResult.Value);
    var items = await _priceSetter.GetPrices<IHavePrice>(username, new List<IHavePrice>() { havePrice });
    havePrice = items[0];    

The code works: I can see changes in context.Result.Value. But on frontend I receive old values in response object.


Related Questions

Sponsored Content

48 Answered Questions

[SOLVED] Deep cloning objects

  • 2008-09-17 00:06:27
  • NakedBrunch
  • 815197 View
  • 2247 Score
  • 48 Answer
  • Tags:   c# .net clone

20 Answered Questions

[SOLVED] How to Sort a List<T> by a property in the object

26 Answered Questions

[SOLVED] Deserialize JSON into C# dynamic object?

1 Answered Questions

[SOLVED] Passing a selected item of listbox into a xaml

1 Answered Questions

C# - Servicestack MongoDB JSON Objects Unescape

1 Answered Questions

[SOLVED] Persisting Changes Made in WPF with Entity Framework

Sponsored Content