TDD and ADO.NET Entity Framework

前端 未结 6 1089
夕颜
夕颜 2020-12-13 10:46

I\'ve been playing with ADO.NET Entity Framework lately, and I find that it suits my needs for a project I\'m developing. I also find cool its non-invasive nature.

A

6条回答
  •  青春惊慌失措
    2020-12-13 11:12

    Although, the original question has been answered, I feel like I might add something:

    I am currently using the Entity Framework 4.0 on an intranet site I'm building. I am able to test everything in my business logic and controllers without a database connection using the POCO support that has been added.

    Although, the POCO's can be generated from the new t4 template included in VS 2010, something that I haven't been able to find in VS 2010 is a t4 template for generating your object context (the object context basically works as a built in unit of work for EF and is essential for mapping your EF objects to POCOs). Luckily Joachim Lykke Andersen in his blog post Entity Framework 4.0 Beta 1 – POCO, ObjectSet, Repository and UnitOfWork wrote a t4 template for generating it and it has been very helpful. If you pursue a solution using the EF4 that is testable without a database connection I highly recommend implementing something similar to his solution which includes a generic repository, unit of work wrapper, and a unit of work factory. It has been very helpful.

    Best of luck.

提交回复
热议问题