Wpis z mikrobloga

Witam czy ktoś z was drogie mirki miał może taki problem z asp .net core podczas uruchomienia nowo utworzonej strony An error occurred while processing your request._
_Development Mode

Swapping to Development environment will display more detailed information about the error that occurred.

Development environment should not be enabled in deployed applications, as it can result in sensitive information from exceptions being displayed to end users. For local debugging, development environment can be enabled by setting the ASPNETCORE_ENVIRONMENT environment variable to Development, and restarting the application.
_ Web config



HomeController

public IActionResult CreateConferences()
{
var conference = new Conference(){
Name ="firdty",
TicketPrice = 12
};
ctx.Conferences.Add(conference);
ctx.SaveChanges();

var sessionsTitles = new List{
".net core", " asp net core", "entity framework core"
};
foreach(var title1 in sessionsTitles){
var session = new Sessio(){
Title = title1,
Conference = conference
};
ctx.Sessions.Add(session);
ctx.SaveChanges();
}
return RedirectToAction("Conference");
}

public IActionResult Conference(){

var conference = ctx.Conferences.First();
return View(conference);
}

Widok

@model new.Models.Conference

@{
ViewData["Title"] = "Conference";
}
@Model.Name
-----------

#naukaprogramowania #programowanie #csharp #net #core
#aspnet