Hello and thanks for reading this.
Me and some friend at school as creating a project to learn a new way to make entity database.
But we get this error : Object reference not set to an instance of an object . And below you can see the 5 lines that makes the error:
Linje 16: Location loc = new Location() { Name = "Aalborg" };
Linje 17:
Linje 18: _db.Locations.Add(loc);
Linje 19: _db.SaveChanges();
Linje 20: }
LINE 18 is the problem;
Since i cant attach files to this it might be a bit huge.
Default site and the Default.aspx.cs :
<%@ Page Title="" Language="C#" MasterPageFile="~/Admin/LayoutAdmin.Master" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="CarRental.Admin.Locations.Default" %>
<asp:Content ID="C ...
Go to the complete details ...