TrattTratt
TrattTratt
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
okay thanks
19 replies
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
ok
19 replies
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
thanks, okay, wierd that I cant find any simple solution for just accessing data from the db
19 replies
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
yes its the same db
19 replies
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
what do u mean with configuration loaded in both contexts? I tried adding DbSet FIles to this context as well but it said there already was an table named Files in db
19 replies
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
is it possible to access the data?
19 replies
CC#
Created by TrattTratt on 6/4/2024 in #help
ASP.NET core, Access Table that is defined in another project
To clarify im using the same sql db for two projects, my web app project (where I wanna get the File from the table FIles) and my azure functions project (where I have the Files in the context and where I set the File)
19 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
var testData = req.Form["testData"];
var testData = req.Form["testData"];
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
$code
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
its working! thanks a lot
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
im not sure
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
<TargetFramework>net8.0</TargetFramework> <AzureFunctionsVersion>v4</AzureFunctionsVersion>
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
might be something here? const formData = new FormData(); formData.append("file", e.target["file"].files[0]); formData.append("TestValue", "contentvalue"); //here I would like to be adding a string that I can get from my fileUpload function const res = await fetch("http://localhost:7036/api/Upload?containerName=products", { method: "post", body: formData, })
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req,[FromForm] MyCoolData data) { try { if(req.Form.Files["file"] is IFormFile file) { var containerName = !string.IsNullOrEmpty(req.Query["containerName"]) ? req.Query["containerName"].ToString() : "files"; var fileEntity = new FileEntity { FileName = _fileService.SetFileName(file), ContentType = file.ContentType, ContainerName = containerName }; var testValueContent = data.TestValue;
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
thanks, now I get when trying to run it. System.NullReferenceException: 'Object reference not set to an instance of an object.' data was null.
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
No description
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
on the record or parameters?
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
like so? record MyCoolData(IFormFile File, string Unga, string Uga, bool Gupo, int Zipzoop); public class Upload(ILogger<Upload> logger, FileService fileService) { private readonly ILogger<Upload> _logger = logger; private readonly FileService _fileService = fileService; [Function("Upload")] public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req, MyCoolData data)
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
public async Task<IActionResult> Run([HttpTrigger(AuthorizationLevel.Function, "post")] HttpRequest req) , should I remove all these parameters?
47 replies
CC#
Created by TrattTratt on 6/3/2024 in #help
ASP.NET core, send more data with formData
can I just do it like this, and where do I get the data in my Run function, formData.append("coolvalue", "testvaluelol");
47 replies