I have the code below in a .cs file and I am coming across the errors below, any help would be appreciated.
using System.Data.Entity;
namespace Assignment2.Models
{
public class TicketBookingEntities : DbContext
{
public DbSet<Performance> Performances { get; set; }
public DbSet<Production> Productions { get; set; }
}
}
Errors:
Error 1 The type or namespace name 'Entity' does not exist in the namespace 'System.Data' (are you missing an assembly reference?)
Error 2 The type or namespace name 'DbContext' could not be found (are you missing a using directive or an assembly reference?)
Error 3 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
Error 4 The type or namespace name 'DbSet' could not be found (are you missing a using directive or an assembly reference?)
To fix this error, simply update the example . csproj file to use a previous System. CommandLine version. Note that this package is only used to parse the options for the example.
The error means the namespace is not found in the partition map (keyed by the specified namespace).
Make sure your project contains a reference to EntityFramework.dll.
See the topic To add a reference in Visual C# in this link if you don't know how to add a reference.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With