what is Repository pattern and code first ....???

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.
12 years ago
Hi everyone.....

i want to know basis ans solution structure of Nop...????

why  Nop.core ,Nop.data ,framework and all are there....???

Is these part of MVC 3 or what.....???

what is Repository pattern and code first ....???

Can you guys explain me....???

Thanks in advance.....
12 years ago
Dharmik wrote:
Hi everyone.....

i want to know basis ans solution structure of Nop...????

why  Nop.core ,Nop.data ,framework and all are there....???

Is these part of MVC 3 or what.....???

what is Repository pattern and code first ....???

Can you guys explain me....???

Thanks in advance.....


Hi Dharmik,

The repository pattern and code first are not a part of MVC3 but they do play well together.

Code first is a concept and it is a way to design a logical database schema. Instead of using SQL Server to build the database schema a developer writes classes and mapping objects to generate and connect to the database server.

The repository pattern is a pattern to control access to the database operations. Instead of giving broad access to operations like queries, inserts, updates, and deletes it is controlled by the repository.
12 years ago
skyler.severns wrote:
Hi everyone.....

i want to know basis ans solution structure of Nop...????

why  Nop.core ,Nop.data ,framework and all are there....???

Is these part of MVC 3 or what.....???

what is Repository pattern and code first ....???

Can you guys explain me....???

Thanks in advance.....

Hi Dharmik,

The repository pattern and code first are not a part of MVC3 but they do play well together.

Code first is a concept and it is a way to design a logical database schema. Instead of using SQL Server to build the database schema a developer writes classes and mapping objects to generate and connect to the database server.

The repository pattern is a pattern to control access to the database operations. Instead of giving broad access to operations like queries, inserts, updates, and deletes it is controlled by the repository.



thanks skyler.severns for giving me such a useful information.....


but can u tell me in NOP how to manage all these things.....???

and how to manage connection string...????

what is role of BaseEntity.cs in Nop.Core....???
12 years ago
Dharmik wrote:

but can u tell me in NOP how to manage all these things.....???

and how to manage connection string...????

what is role of BaseEntity.cs in Nop.Core....???


Sure I'll answer these questions in a different order if you do not mind. The connection string is stored in Nop.Web\App_Data\Settings.txt. In most cases you will not need to do anything special with connection strings.

BaseEntity is an object that all database entities should inherit from. This will allow you to query, update, and delete records in the database. BaseEntity defines an ID and implements the equality operators that are used for tracking domain object state.

To learn more about object tracking you will want to read about Entity Framework 4. To learn more about object equality you should read about object oriented programming.

"Code first" is the combination of a Domain object and its related mapping file. Review my article in the link below to get a better idea what that means.

http://blog.csharpwebdeveloper.com/2011/09/10/updating-an-existing-entity-in-nopcommerce-2-0/

When you need access to database objects you should inject the appropriate repository into your service/controller constructor. The article below will help show you more about injecting repositories.

http://blog.csharpwebdeveloper.com/2011/09/23/nopcommerce-plugin-with-data-access/
12 years ago
skyler.severns wrote:

but can u tell me in NOP how to manage all these things.....???

and how to manage connection string...????

what is role of BaseEntity.cs in Nop.Core....???

Sure I'll answer these questions in a different order if you do not mind. The connection string is stored in Nop.Web\App_Data\Settings.txt. In most cases you will not need to do anything special with connection strings.

BaseEntity is an object that all database entities should inherit from. This will allow you to query, update, and delete records in the database. BaseEntity defines an ID and implements the equality operators that are used for tracking domain object state.

To learn more about object tracking you will want to read about Entity Framework 4. To learn more about object equality you should read about object oriented programming.

"Code first" is the combination of a Domain object and its related mapping file. Review my article in the link below to get a better idea what that means.

http://blog.csharpwebdeveloper.com/2011/09/10/updating-an-existing-entity-in-nopcommerce-2-0/

When you need access to database objects you should inject the appropriate repository into your service/controller constructor. The article below will help show you more about injecting repositories.

http://blog.csharpwebdeveloper.com/2011/09/23/nopcommerce-plugin-with-data-access/





Thanks a lot....

I will go through those links and...

If u dont mind that..

if i will have any query related this ....can you solve my query...????

coz u guys have done great job....to make nop with beautiful architecture....

and very helpful for those who want to learn mvc3 ....

Thank You once again....
12 years ago
Dharmik wrote:

but can u tell me in NOP how to manage all these things.....???

and how to manage connection string...????

what is role of BaseEntity.cs in Nop.Core....???

Sure I'll answer these questions in a different order if you do not mind. The connection string is stored in Nop.Web\App_Data\Settings.txt. In most cases you will not need to do anything special with connection strings.

BaseEntity is an object that all database entities should inherit from. This will allow you to query, update, and delete records in the database. BaseEntity defines an ID and implements the equality operators that are used for tracking domain object state.

To learn more about object tracking you will want to read about Entity Framework 4. To learn more about object equality you should read about object oriented programming.

"Code first" is the combination of a Domain object and its related mapping file. Review my article in the link below to get a better idea what that means.

http://blog.csharpwebdeveloper.com/2011/09/10/updating-an-existing-entity-in-nopcommerce-2-0/

When you need access to database objects you should inject the appropriate repository into your service/controller constructor. The article below will help show you more about injecting repositories.

http://blog.csharpwebdeveloper.com/2011/09/23/nopcommerce-plugin-with-data-access/




Thanks a lot....

I will go through those links and...

If u dont mind that..

if i will have any query related this ....can you solve my query...????

coz u guys have done great job....to make nop with beautiful architecture....

and very helpful for those who want to learn mvc3 ....

Thank You once again....


I guess the best way to is to buy a book , I bought Programming EF by Oreilly , its really good and clears your concepts assuming u have an intermediate knowledge of c# & object oriented programming.
This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.