Tôi có mã bên dưới trong tệp .cs và tôi gặp phải các lỗi bên dưới, mọi trợ giúp sẽ được đánh giá cao.loại tên hoặc không gian tên không tồn tại trong không gian tên
using System.Data.Entity;
namespace Assignment2.Models
{
public class TicketBookingEntities : DbContext
{
public DbSet<Performance> Performances { get; set; }
public DbSet<Production> Productions { get; set; }
}
}
Lỗi:
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?)
** bạn có thiếu tham chiếu lắp ráp không? ** – asawyer
Thử thêm tham chiếu. Nhấp chuột phải vào tệp giải pháp, nhấp vào thêm tham chiếu, sau đó tìm dll thích hợp. – Sandeep
thêm một tham chiếu là hoàn toàn khác nhau để viết 'using Some.Namespace;' –