Using PowerShell to modify package versions in C# Project files
I'd like to use PowerShell to modify the versions of some of our packages. Using this script it works if I just pass in the version number, *but there may be other packages with the same version that ...
- Modified
- 12 May at 04:37
C# - Deserialize DateTime & DateTimeOffset values to UTC and Local Time as required
I'm currently working on a full stack application that has never had to be conscious of time zone, but looks like it will soon need to be a bit more versatile in terms of being aware of local time zon...
- Modified
- 12 May at 04:38
convert the current UTC time to micro seconds format in C#
How to represent current UTC date time in the following format yyyy-MM-ddThh:mm:ss.sssZ I tried this: o/p : 2024-05-10T01:56:36:36Z But the problem is I am getting the seconds restricted to two digits...
Recursively include with EF Core 8?
I'm using EF Core 8. I have a catalog system. It contains pages. Pages can have other pages as well as items. I need to load child pages recursively. I have this But it only loads one level deep. This...
- Modified
- 12 May at 04:40
Handling Errors When Invoking PowerShell Script from C#?
I am trying to invoke a powershell script that makes use of tokens. I see I receive this specific error message. Is just checking this specific message fine and add me recreating the tokens logic? If ...
- Modified
- 12 May at 04:41
Pass templated base class generic child to function without restricting by the template type
I have the following problem. I want to create a baseclass with variable type property that is used internally by the base class and classes that inherit from it as follows: The problem arises when I ...
- Modified
- 12 May at 04:42
Insert DateTime to PostgreSQL with C#
Below is my code: [](https://i.sstatic.net/95uh8FKN.png) Why would the `DateTime.UtcNow` be modified after inserting it into Postgre,...
- Modified
- 12 May at 04:43
lock accessing to a property in C# using methods
I have the following class: So when a thread wants to read the "State" it should be thread-safe however, there is also a possibility to lock that using a public methods an unlock it with another metho...
- Modified
- 12 May at 04:44
How to configure cascade deletion in Entity Framework Core 8
I'm wondering if there's a way to configure cascade deletion for the following ### Scenario When I delete a `File` entity (database row), I want all associated entities to be deleted as well. Currentl...
- Modified
- 12 May at 04:45
How to "fire and forget" an activity in a ASP.NET core which requires Graph API access?
I have an ASP.NET Core 8 Web Application, which uses Entra ID OpenID connect authentication, then uses `graphclient` to access the OnlineMeeting API. All is working. The web application creates an onl...
- Modified
- 12 May at 04:46
How to determine how many character will fit in a label?
I have a label and I want to determine how many characters will fit in the label so I can modify the content before assigning, how can I do this, from the above link I tried: **intWidth** is returned ...
What needs to be passed for IEnumerable<KeyValuePair<string, IEnumerable<string>>>?
How can I pass a method a `IEnumerable>>` A method I'm working with expects this as a parameter, but I can't for the life of me figure out what that should be. I've tried `Dictionary>` and Visual Stud...
EntityFramework .net 6 getting object that are in provided list
I have list of objects used as filter: I have a repository and I want to query like: But it doesnt work, it complains that it cant be converted to sql query, probably because Contains uses complex obj...
How to check which auth scheme was used for current request
I need to implement different logic depending on which auth scheme was used to authenticate the users. Currently i'm using `IAuthenticateResultFeature` feature on the HttpContext, but i'm having a rea...
AddKeyedScoped initializing object with func<IServiceProvider, object?, TService> implementationFactory not working? .NET 8
I have started using `AddKeyedScoped` with .NET 8. I want use my own initialization object for dependency: Has anyone used above implementation for setting key with initialization? For scope this work...
- Modified
- 12 May at 04:52
How to create a custom model binder attribute
I am not sure if this is even possible but I have a model as follows: I am trying to get the Uploader object to fill after model binds. I use this object quite often in many models and depends on acce...
- Modified
- 12 May at 04:54
How To Support Range Requests In ServiceStack For application/json
The ServiceStack docs say that "HTTP Partial Content Support is added in true ServiceStack-style where it's now automatically and transparently enabled for any existing services returning" and then it...
- Modified
- 29 Aug at 10:47
Disable BasicAuth fallback
According to the documentation: https://docs.servicestack.net/auth/authentication-and-authorization#authenticating-with.net-service-clients > Although behind-the-scenes it ends up making 2 requests, 1...
- Modified
- 29 Aug at 10:49
Is there a way to limit DTOs returned back from /types/typescript?
We have an api which serves 2 SPA sites and we use the models from /types/typescript in both. One of the sites only uses one services worth of DTOs but it has to use the generated file with all DTOs, ...
- Modified
- 29 Aug at 10:50
How can we use MySql Select Case construct in ORMLite ServiceStack
SqlExpression sqlExp = db.From() .Where(l => l.e01f02 == EmployeeId && l.e01f07 == LeaveStatus.Approved) .Where($"(e01f04 >= '{MonthFirstDate}' AND e01f04 = '{MonthFirstDate}' AND ADDDATE(e01f04, ...
- Modified
- 29 Aug at 10:51
Using ServiceStack, is it possible to create Derived Request class?
I have a situation where the only API offered to me returns many items and I want to make a derived request that will only return one item. Here's what my attempt looks like: Returning the list of quo...
- Modified
- 29 Aug at 10:53
Overriding ExecuteAsync on AuthenticateAttribute using Servicestack OrmLite
We have a .net 6.0 MVC web application running with ServiceStack Ormlite 6.0.2. We have a custom `AuthenticateAttribute` that extends the Servicestack AuthenticateAttribute. The intention is to to use...
- Modified
- 29 Aug at 11:37
How to avoid a ServiceStack API Explorer DTO binding error for a GET request when some of the form inputs are null
I'm currently using [ServiceStack 6.10](https://docs.servicestack.net/releases/v6_10) and in the [ServiceStack API Explorer](https://docs.servicestack.net/api-explorer) I have the following Form for o...
- Modified
- 29 Aug at 11:39
ServiceStack ORM Lite Left Join query filter
I am not able to filter out the records correctly. q = q.LeftJoin((pi, pipl) => pi.Id == pipl.PurchaseInvoiceId); q = q.Where(s => Sql.In(s.ProjectId, UserSession.ProjectIds)) || s == null ); The ...
- Modified
- 29 Aug at 11:41
How do I get ServiceStack's x csharp to generate dto's for only a specific type
I'm using the ServiceStack `x` tool with the `csharp` option to generate a C# dtos.cs file. On first create it works great. I've used its generated content to move DTO's to dto-specific files, and app...
- Modified
- 29 Aug at 11:42