için eklenmiştir. "Entity Framework DbContext" i kullanıyorum. Bu çok garip çünkü web sitemde her zaman towar.dbo hakkında soru soruyorum ama hayır towars.dbo Sorun nerede olduğunu biliyor musunuz? Towar (benim programda elbette farklı bir yerde) hakkındaVarlık Çerçevesi, .dbo
- InnerException {"Invalid object name 'dbo.Towars'."} System.Exception {System.Data.SqlClient.SqlException}
Benim her şeyin:
public class ProductController : Controller
{
//
// GET: /Product/
public ITowarRepository repository;
public ProductController(ITowarRepository productRepository)
{
repository = productRepository;
}
public ViewResult List()
{
return View(repository.Towar);
}
}
public interface ITowarRepository
{
IQueryable<Towar> Towar { get; }
}
public DbSet<Towar> Towar { get; set; }
public class EFTowarRepository : ITowarRepository
{
public EFDbContext context = new EFDbContext();
public IQueryable<Towar> Towar
{
get { return context.Towar; }
}
}
public class Towar
{
[Key]
public int Id_tow { get; set; }
public string Nazwa { get; set; }
public string Opis { get; set; }
public decimal Cena { get; set; }
public int Id_kat { get; set; }
}
db tablo adı nedir @ Bütünlük adına? Doğru db'ye bağlandın mı? veritabanını yapmak – Shyju
bağlantısını doğru connectionStrings> –
RPD