Category "c++sharp"

Microsoft.OpenAPI examples or documentation?

Just tried to use Swashbuckle 5 rc2 + Microsoft OpenAPI implementation but struggling to make sense of how to inject the security requirements using the OpenApi

How to mock an IFormFile for a unit/integration test in ASP.NET Core?

I want to write tests for uploading of files in ASP.NET Core but can't seem to find a nice way to mock/instantiate an object derived from IFormFile. Any suggest

How to implement left join in JOIN Extension method

I am trying to implement an outer join on this kind of query for the p.Person table. How would I do this? This example is taken from http://ashishware.com/DSLi

Areas do not work when migrating an Angular app to NET 6

I have an .NET Core 5 with Angular app and I have my controllers grouped in areas. I made the app using NET Core 1 and have successfully migrated it up to 5 wit

What is the difference between “int” and “uint” / “long” and “ulong”?

I know about int and long (32-bit and 64-bit numbers), but what are uint and ulong?

VS 2022 - cannot change Target Platform to .Net 6.0 for a project created in VS 2019

Just installed VS 2022 on a machine, after I removed VS 2019 (VM with limited space). VS 2022 installed fine. I can create a .Net 6.0 project and compile it -

How can I get task-specific properties from a MailItem

I've been having a little weekend project for myselff which involves getting all my ToDo tasks from Outlook, put them in a DataGridView and me being able to edi

Drawing a line on a bitmap

I made a face dector in matlab, and I am translating it into c# code, I everything is moslty done. In the main I use System.Drawing.Bitmap b = new Sy

how do i return this instance of the IInfocard interface?

i am currently trying to return a instance of the Iinforcard interface within my "createNewInfocard" function, however i keep running into error CS0266. i am un

Update button in datagrid, entity framework WPF Application

I'm attempting to create an update button, that you can press to automatically update a record within a DB. the update button opens a new dialog, which then all

Is it possible to superimpose an interface on an external class in C#?

In order to hide the concrete implementation of a class behind an interface, for example for dependency injection, I find it is useful to extract an interface w

Problem in Azure DevOps pipeline restoring AutoMapper NuGet package in .net 6

I get the following error message when my pipeline is being run: Package AutoMapper.Extensions.Microsoft.DependencyInjection 8.1.1 is not compatible with net60

How can I get task-specific properties from a MailItem

I've been having a little weekend project for myselff which involves getting all my ToDo tasks from Outlook, put them in a DataGridView and me being able to edi

Mapping columns in a DataTable to a SQL table with SqlBulkCopy

I would like to know how I can map columns in a database table to the datatable in c# before adding the data to the database. using (SqlBulkCopy s = new SqlBul

The server response was: 5.7.0 Must issue a STARTTLS command first. i16sm1806350pag.18 - gsmtp

I am trying to send mail using gmail, and I am getting an exception that is The SMTP server requires a secure connection or the client was not authenticated. Th

Is there a nameof() operator for MVC controllers in C#?

The newly introduced nameof operator is useful in making my code my "typed". Instead of return RedirectToAction("Edit"); we can write return RedirectToAct

Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host

I have an update server that sends client updates through TCP port 12000. The sending of a single file is successful only the first time, but after that I get a

How to delete the current cell in DataGridView?

How can I delete a current cell in a DataGridView. I am trying the code below, but it is deleting all cells except the current one. private void dgvPurchase_C

IEnumerable vs List - What to Use? How do they work?

I have some doubts over how Enumerators work, and LINQ. Consider these two simple selects: List<Animal> sel = (from animal in Animals

playwright- issue with login form - how to navigate to next page

I have a website where I enter the username and password, then I click on the recaptcha field and enter the numbers without any problems but when the login butt