↧
Answer by Simon_Weaver for How to update dependency injection token value
Regarding WHY...Since you were also wondering WHY you might want to inject a static structure, Angular Material does this quite often to provide configuration to components.eg. for Chips...
View ArticleComment by Simon_Weaver on How to extract the generic parameter from a type?
@BartłomiejStasiak wow I got a lot of upvotes for that didn't I!
View ArticleHow to simulate Server.Transfer in ASP.NET MVC?
In ASP.NET MVC you can return a redirect ActionResult quite easily: return RedirectToAction("Index"); or return RedirectToRoute(new { controller = "home", version = Math.Random() * 10 });This will...
View ArticleAnswer by Simon_Weaver for Density in Angular Material Design for single...
If you want to do it for all buttons in the component you can do this::host { // this particular example is for icon button @include mat.icon-button-density(-3);}This way you are still of course...
View ArticleComment by Simon_Weaver on Can anonymous class implement interface?
Literally the worst solution to the question as asked lol
View ArticleComment by Simon_Weaver on Use a LIKE statement on SQL Server XML Datatype
@FMFF sorry I always try to avoid namespaces. Don't know off hand.
View ArticleComment by Simon_Weaver on WCF service with Full Memory Error (Memory gates...
There's actually 5) You have 96GB of RAM on your laptop and therefore 5% is almost 5GB. Windows has taken up almost all your RAM even though you don't have anywhere near that many things open, but...
View ArticleComment by Simon_Weaver on WCF service with Full Memory Error (Memory gates...
lol hi from 10 years in the future. Where my laptop has 96GB and I still get this error because even with 4GB free RAM I'm now under 5% available memory!!
View ArticleAnswer by Simon_Weaver for How to determine if a related child-entity has...
You don't need to do it through the ChangeTracker object, or manually find the entity.Here's an example for a collection:var isOrderItemsLoaded = MyContext.Entry(order).Collection(i =>...
View ArticleComment by Simon_Weaver on Sending an object with a command parameter
If you want to send multiple properties via CommandParameter see this question stackoverflow.com/questions/1350598/…
View ArticleComment by Simon_Weaver on Passing two command parameters using a WPF binding
BTW. If you want to bind the whole object as one of the parameters use <Binding />
View ArticleComment by Simon_Weaver on How can I convert a Sql Server 2008 DateTimeOffset...
Why include AT TIME ZONE 'UTC'? Maybe that's needed for datetime, but not for datetimeoffset?
View ArticleComment by Simon_Weaver on Log event datetime with.Net Core Console logger
In Visual Studio there's a little clock icon in the Output window that enables timestamps.
View ArticleAnswer by Simon_Weaver for rowVersion gets mapped to byte[8] in Entityframe...
In the debug logs EF Core shows timestamps in the same format that they appear in SQL Server Management Studio. I needed to be able to convert the byte[8] for timestamp / rowversion to the same format...
View ArticleAnswer by Simon_Weaver for Log event datetime with.Net Core Console logger
Visual Studio / .AddDebug() not showing timestampsIf you're in Visual Studio and needing timestamps on debug logs (eg. logs from EF Core showing SQL) the only option AFAIK (since AddDebug has no...
View ArticleAnswer by Simon_Weaver for How to get isolation level in EF for MSSQL?
In EF Core this works:System.Transactions.Transaction.Current.IsolationLevelIt's showing Serializable for me by default if I don't specify a level, and does show the updated value if I set it...
View ArticleComment by Simon_Weaver on Hangfire - Prevent multiples of the same job being...
IMPORTANT: Jobs don't actually get queued separately when you use this attribute. It will look like both jobs are running simultaneously in the console (provided you have available threads) - because...
View ArticleComment by Simon_Weaver on How can I clean Hangfire SQL database, keeping the...
Note: The job runs every half an hour which can be changed with JobExpirationCheckInterval. If you reduce it to help expedite cleaning out of existing records remember to remove it later. The default...
View ArticleAnswer by Simon_Weaver for Subscribing to Observable Input
Edit: This answer is mostly outdated now due to Angular signals.I'm really not a fan of passing an Observable as an @Input itself, but I'm a big fan of turning a standard @Input()into an Observable....
View ArticleComment by Simon_Weaver on How to fire the `valueChanges` programmatically?
I'm just realizing now there may be a way to use defer and concat to get the initial value (instead of using startWith), but I don't have time to test it now.
View Article
More Pages to Explore .....