electronic heartbreak.
electronic heartbreak.
CC#
Created by electronic heartbreak. on 7/18/2024 in #help
Using IFormFile in Web API project results in network failure.
Anyone that can help me look into this issue?
6 replies
CC#
Created by electronic heartbreak. on 7/18/2024 in #help
Using IFormFile in Web API project results in network failure.
Project:
c#
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

</Project>
c#
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net8.0</TargetFramework>
<Nullable>enable</Nullable>
<ImplicitUsings>enable</ImplicitUsings>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Swashbuckle.AspNetCore" Version="6.4.0" />
</ItemGroup>

</Project>
6 replies
CC#
Created by electronic heartbreak. on 7/18/2024 in #help
Using IFormFile in Web API project results in network failure.
Program.cs (to enable double post in single controller):
c#
builder.Services.AddSwaggerGen(options =>
{
options.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
});
c#
builder.Services.AddSwaggerGen(options =>
{
options.ResolveConflictingActions(apiDescriptions => apiDescriptions.First());
});
6 replies
CC#
Created by electronic heartbreak. on 7/18/2024 in #help
Using IFormFile in Web API project results in network failure.
D:\ImageUpload\bin\Debug\net8.0\ImageUpload.exe (process 16644) exited with code -1.
6 replies
CC#
Created by electronic heartbreak. on 7/18/2024 in #help
Using IFormFile in Web API project results in network failure.
c#
public class DtoImage
{
public string Name { get; set; }
public IFormFile File { get; set; }
}
c#
public class DtoImage
{
public string Name { get; set; }
public IFormFile File { get; set; }
}
6 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
yeah that package is still in its baby phase. cant use that in production
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
Mongo has no integration with EF.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
I use mongo so there is no validation :kekw:
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
during the process from receiving the data to storing it, the data should be validated.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
When storing stuff in the DB, you want the data to be correct (i mean thats a fact)
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
the domain objects should be valid when theyre created or when theyre ready to be stored in a database.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
Yes i have that, definitely dont worry about that part :). I am just struggling with the validation part between the DTO and Entity.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
When Mr. chatgpt generates an example I see it do the following: 1. The DTO has basic validation 2. The entity constructor has complex validation 3. An exception gets thrown when the complex validation fails.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
Okay good haha 😄
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
Well, I need to use DTO/Entitities since my Entity contains properties i dont want to expose to a client. A DTO is excellent in this case.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
that enum one was just an example, but i get that it might belong to the DTO
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
Cant i do the following? 1. Add basic validation like required,min/max length to the DTO 2. map the DTO to the entity 3. Perform more advanced validation to the Entity 4. By errors, return an error and if correct perform a save to the database
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
I am currently at my first ever job and making choices is the hardest part of it 😉
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
oh yeah thats for sure.
91 replies
CC#
Created by electronic heartbreak. on 7/13/2024 in #help
How is Modelstate.IsValid triggered?
it just maps
91 replies