Repository pattern without entity framework?

Is it possible to implement the Repository pattern without using entity framework?

I am working on a small dev team of 3 on a small scale (for now) ASP.NET MVC solution. I told my manager that I think that we need a layer of abstraction between our business logic and our controllers. Right now our controllers contain a lot of the business logic that goes on, and other functionality, which I know is bad practice.

I have used the repository pattern in the past at my last position, but I did not implement it there. And I cannot say that I have 100% ‘wrapped my head around’ the pattern and would know how to implement it on my own. There are so many tutorials out there for this pattern and they all seem to differ usually, even if it is a slight difference.

Another concern of mine is that the other programmer on my team (senior dev) said that we don’t need to switch to EF right now. I think because our project is still small, and we don’t have the time to make the switch. I respect and understand this so I am wondering if it is possible to still use this pattern without EF.

If so, does anyone have useful tutorials, examples or references?

If not, what should I look to do next? I don’t want to show up empty handed. I may just represent our (real world) objects as classes that store and provide functionality. That way there will hopefully be less logic and functionality being performed in the controllers.

Thanks for reading.

1

Design patterns like the Repository pattern aren’t dependent on particular technology, so the obvious answer to your question is “yes, of course you can”. You can write repositories which are ultimately backed by any storage technology – the point is that the Repository pattern is a way of structuring your data access code and separating it from your other code. It’s described in such a way as to be independent of programming language – provided the language in question has objects and interface inheritance you can make it work.

What it isn’t is a way of structuring your business logic and separating it from your view controllers, which is what your explanation actually says you need. For that you’ve got a number of other options available. Where I work we write a set of Service objects which provide business logic, and the controllers call those (they in turn have Repository objects injected by the DI framework to allow them to access data storage without having to know all the details). Controllers then only contain code which deals with processing incoming data from the UI into a form the services can handle, and turning service responses into something suitable for display to the user.

2

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật