oibo8x / subsonicproject

Automatically exported from code.google.com/p/subsonicproject
0 stars 0 forks source link

With Repository pattern some methods seem to be missing #15

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1. Static methods like Class.Find() do not exist with Repository pattern.
2. The only way to Find() a record is to get the entire collection, and 
then Find() like
new ProductCollection().GetList().Find(...);

instead of just

Product.Find(...);

Correct me if I'm wrong.

What version of the product are you using? On what operating system?
Subsonic 2.1 final

Please provide any additional information below.

This was suggested by yitzchok 

original forum thread:
http://forums.subsonicproject.com/forums/t/3526.aspx

thanks

hardball551

Original issue reported on code.google.com by hardball...@gmail.com on 22 Jul 2008 at 12:04

GoogleCodeExporter commented 9 years ago
This is by design. Your queries should go through the repositories instead of 
hanging 
off the collections. For example:

var products = 
DB.Select().From<Product>().Where(...).IsEqualTo(...).ExecuteCollection<ProductC
ollec
tion>();

I responded to the forum post. Any discussion on this can continue there and 
we'll 
reopen a new issue if needed.

Original comment by johnshee...@gmail.com on 1 Apr 2009 at 4:43