What is the right way to interact with the Database?

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
1) Create a Table on DB

2) Add a MyModel.cs file on Nop.Core.Domain.Foo folder that inherits from BaseEntity

3) Add a IFoo.cs interface file on Nop.Services.Foo

4) Add a FooService.cs implementation file on Nop.Services.Foo a FooService

5) On the FooService.cs file add the following:
      private readonly IRepository<MyModel> _variable
      Constructor that initiates that _variable

6) Create a method that uses linq to retrieve data from the DB with "_variable.Table".


But this gives me the following error:
The entity type "MyModel" is not part of the model for the current context


What am I doing wrong ??
Thanks in advanced

...FP
12 years ago
https://www.nopcommerce.com/boards/t/11295/the-entity-type-taxratebycity-is-not-part-of-the-model-for-the-current-context.aspx#45964
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.