Vortac
Vortac
CC#
Created by Vortac on 1/24/2024 in #help
Interface Design Question
Thank you!
14 replies
CC#
Created by Vortac on 1/24/2024 in #help
Interface Design Question
Okay, so from what I can see in the docs, any properties not specified in my model class will be ignored by default, so I can remove the ones I don't need. But then I still have the difference of A having a RefreshToken that may or may not be null (it isn't null on day 15), whereas B only has AccessToken
14 replies
CC#
Created by Vortac on 1/24/2024 in #help
Interface Design Question
For TokenGetter A, I receive a token and a an optional refresh token that appears every 15 days (B does not do this). The JSON class to deserialize into is also different from B
14 replies
CC#
Created by Vortac on 1/24/2024 in #help
Interface Design Question
What's wrong with using the generic interface? Out of curiosity
14 replies
CC#
Created by Vortac on 1/25/2024 in #help
How to use Server Sent Events with HttpClient
Ideally using only httpclient as I’m writing a library and would like to avoid external dependencies if possible
6 replies
CC#
Created by Vortac on 1/25/2024 in #help
How to use Server Sent Events with HttpClient
6 replies
CC#
Created by Vortac on 1/24/2024 in #help
Interface Design Question
The JSON responses varied
14 replies
CC#
Created by Vortac on 1/24/2024 in #help
Interface Design Question
This is what I ended up doing, thanks!
14 replies
CC#
Created by Vortac on 12/17/2023 in #help
✅ Streaming From REST API?
Say this is for a chat and I want to pass a ChatRequest object, would I open the stream first and then pass it?
15 replies
CC#
Created by Amaral on 11/29/2023 in #help
Web Api C# in Linux Ubuntu
I was trying the msft repos because they have 8
4 replies
CC#
Created by Amaral on 11/29/2023 in #help
Web Api C# in Linux Ubuntu
Are you using the Microsoft repos? I’m on Linux mint and was running into a similar error. The Ubuntu repo only has .net 7, but I needed to install from the Ubuntu repo (after removing the Microsoft one and all dot net packages) and then everything worked
4 replies
CC#
Created by Vortac on 11/24/2023 in #help
✅ ASP Net 7 - Return list of objects as an object with a nested list
I have an endpoint called /api/pages/{id} where users can pass a pageId to get that specific page, but I can see why it would be hidden in other cases
6 replies
CC#
Created by Vortac on 11/24/2023 in #help
✅ ASP Net 7 - Return list of objects as an object with a nested list
There's no fields in the DB object that need to be kept hidden:
public class Page
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string? Title { get; set; }
public string? Body { get; set; }
public string? Author { get; set; }
}
public class Page
{
[Key]
[DatabaseGenerated(DatabaseGeneratedOption.Identity)]
public int Id { get; set; }
public string? Title { get; set; }
public string? Body { get; set; }
public string? Author { get; set; }
}
but I assume there should be a second class called PageDto to send to the client?
6 replies
CC#
Created by Vortac on 11/20/2023 in #help
Dynamically enable/disable a route in ASP.NET 7?
What do you mean registration and create?
17 replies
CC#
Created by Vortac on 11/20/2023 in #help
Dynamically enable/disable a route in ASP.NET 7?
I want to be able to have a toggle for an admin to enable or disable new users signups, and if its disabled then I don't want anyone except admins being able to make a call to the registration endpoint
17 replies
CC#
Created by Vortac on 11/20/2023 in #help
Dynamically enable/disable a route in ASP.NET 7?
I currently have JWT authentication setup, so once a user registers and then logs in they get a bearer token to make API calls to protected endpoints for example, users have to provide a token to POST to a certain endpoint but the issue is, they can still access the register endpoint to create an account, if I make that authorized only, then someone who wants to enable public signups can't
17 replies