Juicy
Juicy
CC#
Created by Juicy on 9/14/2023 in #help
❔ SignalR for real-time REST api data in WPF?
Hey, Im working on a hobby WPF application that needs to consume a rest api for real-time updates on game camera positions. Since the camera position data is always updating I want my wpf app to reflect those updates in realtime....would signalR be a good solution or is api polling good enough? Or anyone has any other recommendations for a straightforward way to ensure the client recieves near real-time updates from the rest api? Thanks!
45 replies
CC#
Created by Juicy on 12/14/2022 in #help
No route matches supplied values but values seem to match?
Hi I am getting this error on return CreatedAtAction:
System.InvalidOperationException: No route matches the supplied values.
System.InvalidOperationException: No route matches the supplied values.
var response = new UserResponse(
user.Id,
user.ProductId,
user.Username,
user.Role,
user.CreatedOnUtc);

var actionName = nameof(GetByIdAsync);
var routeValues = new {productId, id = user.Id, cancellationToken};

return CreatedAtAction(actionName, routeValues, response);
var response = new UserResponse(
user.Id,
user.ProductId,
user.Username,
user.Role,
user.CreatedOnUtc);

var actionName = nameof(GetByIdAsync);
var routeValues = new {productId, id = user.Id, cancellationToken};

return CreatedAtAction(actionName, routeValues, response);
[HttpGet("{id:guid}")]
public async Task<ActionResult> GetByIdAsync(Guid productId, Guid id,
CancellationToken cancellationToken = default)
{
[HttpGet("{id:guid}")]
public async Task<ActionResult> GetByIdAsync(Guid productId, Guid id,
CancellationToken cancellationToken = default)
{
But how are the route values incorrect when im giving it productId and the userId? To note, they also exist in the same controller and user.Id + productId are both guids (productId comes from parameter).Dont really understand what im missing here, let me know if you need me to provide more information
38 replies