Sending File and Data to a Minimal API endpoint
Hi. I am using .NET 7, Minimal API and Mailkit.
What I want to do is to send an attachment along with other information in an email. I want to receive both the information and the file using a Form-Data request type but I am having problems receiving the information .
The error I am getting is:
.
Here is the endpoint code :
And here is the REmailWithAttachments class:
A
Angiusโข400d ago
Bit of a stab in the dark, but could it be because of the constructor?
Either delete it since it's not needed, or add a default constructor
P
13p14โข400d ago
I tried that but still the same problem ๐ข
P
13p14โข400d ago
Oh, it looks like they are still working on it:
https://github.com/dotnet/aspnetcore/issues/39430
GitHub
Support Form binding for Minimal endpoints ยท Issue #39430 ยท dotnet/...
Support for simple types. ##44653 Suport for complext types. Support for IFormCollection
A
Angiusโข400d ago
Ah, another reason to not use minimal APIs then
P
13p14โข400d ago
Had to learn it the hard way
We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.
52KMembers
View on DiscordWant results from more Discord servers?
More Postsโ reprotucing the kings pathcan anybody help me fix this code
https://paste.mod.gg/sgsvrbaqnmpi/0
```
the input is
number of obsโ Its there a way to fix this?Hi there, currently I am trying to develop some functions to publish them to azure later, but right โ
Does this styling code look right?I'm using this code for a simple hover effect. Im wondering if I'm doing this correctly:
<Window.Reโ ?[] operator for dictionariesIs not working. It is explained here. https://learn.microsoft.com/en-us/dotnet/csharp/language-referโ IAsyncEnumerable vs List<T> as parameter in methodI have a method that is overloaded and will take in a List<T> or IAsyncEnumerable. The method will bโ This code is bugged how can i solve it?```LogiwaEntities1 db = new LogiwaEntities1();
ProductData productData = new ProductDataโ
How to add hover effect to WPF button elementThis code I'm using isn't working. When I hover over buttons its a lightblue color.
<Style with or without refso i learned that in c#(or most oop languages) when you create a method that takes an object as a paโ
.net trying to find non-existent cs files`Error IDE1100 Error reading content of source file 'D:\Dev\C++\Test\TestCS\obj\Debug\net6.0\.โ WPF - Binding to last child of collectionI have the following setup:
```csharp
public partial class StatusMessageService : ObservableObject
โ
What does WPF want from me?I'm actually so tired of WPF and MVVM and all this contrived fuckin bs you guys
MainWindow control:โ I apparently have an infinite loop, but I can't fix it to workI've tried a lot of stuff, even a "NewtonJson" fix I saw, but it wouldn't solve the problem because โ
doing nothingdfgโ I would appreciate some help.So i have this assignment and in lieu of my grandma who passed this past week i've not had the oppor