Category "c++sharp"

How to Bulk Update records in Entity Framework?

I am trying to bulk update records using Entity Framework. I have tried Entity Framework.Extensions Update method. The Update method is able to bulk update for

SignalR Client How to Set user when start connection?

Server side: public override Task OnConnected() { var connectionId = Context.ConnectionId; var user = Context.User.Identity.Name; // Context.User is NU

xunit test for IFormFile field in Asp.net Core

I have an Asp.net Core method with below definition. [HttpPost] public IActionResult Upload(IFormFile file) { if (file == null || file.Length == 0)

Unity Photon PUN RPC call

I have a question about RPC and Photon PUN. I have 1 GameObject in my game that calls an RPC method. This game object contains a C# script (that contains the

How to generate an extent report for POM QA automation framework with updated classes?

I am developing a QA automation framework using a Page Object Model in C#. I want to get a report about passed and failed test cases. I think Extent Reports is

TLS 1.2 - Alert Level - Fatal - Description Protocol Version

I am trying to connect to a web service which uses 2-way authentication on TLS version 1.2. The SSL handshake fails and I get the following handshake error when

Return response with errors instead of throwing exception in validation pipeline mediatr 3

I am currently working with Pipeline behavior in Mediatr 3 for request validation. All the examples that I came across were throwing ValidationException if any

Setting headers for Odata client

I've been trying to set authorization header value for Odata client. After I instantiate the client, I do it like this: container.BuildingRequest += (sender, e

How do I trigger a form to close when it loses focus

I have two forms, form1 and form2. form1 has a button that when clicked opens form2 center screen over form1. form2 is smaller than form1 (on purpose). If the c

C# Incremental Source Generator caching bug?

I'm trying to wrap my head around the new Roslyn Incremental Source Generators, by making a simple generator, that lists all invoked methods in a file called In

Change the headers of static files in Asp.net Core

I am using package Microsoft.AspNet.StaticFiles and configuring it in Startup.cs as app.UseStaticFiles(). How can I change the headers of the delivered files ?

Simple way to add extra parameter to Automapper ForMember

So, I have a mapping ObjectFrom to ObjectTo. ' All mappings can be done ObjectFrom.propX -> ObjectTo.propX2. But there is also a property in ObjectTo that ne

Is there a way in C# to find the current location of a shortcut target programatically?

Windows shortcuts use the Distributed Link Tracking service to get the current location of shortcut target which has moved or renamed when the link is clicked o

How do I implement a global keyboard hook using GTk2 C# Visual Studio on mac?

This is not a duplicate question. I have read lots of implementations of low level / global keyboard hooks using C# but none of them have yet provided a solutio

Why Return Base Method With Blazor OnInitialized Method

I am seeing more and more examples of OnInitialized and OnInitializedAsync() returning base.OnInitialized[Async]. But Why? The examples on the Microsoft websit

Visual Studio C# Get sheet visible property

I'm trying to fill a dictionary with name as key, and an array with codename and if sheet is visible. This is where I ran into a conversion issue with sheet.vis

To filter mails from inbox which are sent to another recipient?

In Outlook Interop, using Outlook = Microsoft.Office.Interop.Outlook; To filter unread emails, I'm using the following code Outlook.Application oApp = new Out

How to search a word in a RichTextBox having specific format?

I have a RichTextBox where the user will copy-paste from MS Word an MCQ quiz question. The correct choice would either be highlighted or with bold text (e.g. in

Unity Addressables: RemoteProviderException : TextDataProvider : unable to load from url /base.apk!/assets/aa/settings.json

I have followed closely the samples for using the play asset delivery in my project as it is from here: https://github.com/Unity-Technologies/Addressables-Sampl

Why are some characters ignored when calling LastIndexOf?

Please take a look at these codes : string str_to_find = "➖➖➖➖➖➖➖➖➖➖\r\n"; string str