skip to Main Content

ASP.NET Core API not accessible from React.js (CORS)

I'm working on a web app using React for the frontend and ASP.NET Core for the backend. This is code from my Startup.cs. public void ConfigureServices(IServiceCollection services) { services.AddControllers(); services.AddCors(options => { options.AddDefaultPolicy(builder => { builder.WithOrigins("*").AllowAnyHeader().AllowAnyMethod(); }); }); } This…

VIEW QUESTION

Mingw produces x86 program which only successfully runs as Administrator- x64 and VS(x86 and x64) versions fine – Debian

I was taking a look at this Github project: https://github.com/LloydLabs/delete-self-poc This project uses the SetFileInformationByHandle API (https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-setfileinformationbyhandle) in a somewhat creative way to allow the deletion from disk of a locked file. I am attempting to implement this as part…

VIEW QUESTION

Id not getting passed to Partial View form – Asp.net

Parent View: @Html.Action("SetReview", "Review", new {sellerId = Model.SellerId}) [HttpGet] public ActionResult SetReview(string sellerId) { return PartialView("_Review", new Finder.Models.Review() { SellerId = sellerId }); } This is the part where the Id is not getting passed [HttpPost] public ActionResult SetReview(Finder.Models.Review review)…

VIEW QUESTION

Unit testing – casting an OkResult. What happens if the object cannot be cast to OkResult? – Asp.net

I've just started Unit Testing and I'm having some trouble understanding how should I write them. I have this code [Theory] [InlineData("00000000-0000-0000-0000-000000000001")] [InlineData("00000000-0000-0000-0000-000000000002")] public void Delete_Intern(Guid id) { _internService.Setup(x => x.Delete(It.IsAny<Guid>())).Returns(true); var actual = (OkResult) _internsController.DeleteIntern(id); Assert.True(actual is OkResult); }…

VIEW QUESTION
Back To Top
Search