| | | 
Progenic Family

Group: Old Skool Last Login: Monday, July 14, 2008 10:40 PM Posts: 1,064, Visits: 4,353 |
| | | | | 
Progenic Crew

Group: Administrators Last Login: Yesterday @ 12:27 PM Posts: 2,388, Visits: 37,337 |
| cheers 
|
| | | | New Member

Group: Forum Members Last Login: Friday, June 13, 2008 10:46 AM Posts: 3, Visits: 11 |
| | | | | 
Progenic Crew

Group: Administrators Last Login: Yesterday @ 12:27 PM Posts: 2,388, Visits: 37,337 |
| | lok can you point me in the direction of any resources you know that might help me learn. So far i've set it up on one of my databases and managed to use the dataadapter and a entity class. I found this ebook http://www.lulu.com/content/174470, do you know of any other books? @wax have you been using linq at all? i'm a bit lost to be honest just be reading through this http://weblogs.asp.net/fbouma/archive/2008/05/19/why-use-the-entity-framework-yeah-why-exactly.aspx and the comments, it seems there's a firey debate raging over what is best to use and i'm trying to work out the truth between the different philosophys. Could you explain why link2sql makes the need for stuff like llblgen redundant?
|
| | | | 
Progenic Family

Group: Old Skool Last Login: Monday, July 14, 2008 10:40 PM Posts: 1,064, Visits: 4,353 |
| proge i didn't learn llblgen from a book or anything [company i worked at had projects in it]
i can maybe whip up a sample or two for you later [when i'm at work]
best place for llblgen,help at least, is the forums at llblgen.com
the .chm that comes with the llblgen install is also a nice place for tips/etc
we use it in adapter mode (not self-servicing). adapter is the better way.
will post some 'typical' snippets tommorow
--
http://www.boxofgoodfeelings.com/
http://lets.coozi.com.au/ |
| | | | 
Progenic Crew

Group: Administrators Last Login: Yesterday @ 12:27 PM Posts: 2,388, Visits: 37,337 |
| cool thanks, yea i read enough to realise adapter was the way to go 
|
| | | | 
Progenic Family

Group: Old Skool Last Login: Monday, July 14, 2008 10:40 PM Posts: 1,064, Visits: 4,353 |
| sample code to get customers and a bunch of tables related to them due to FK constraints:
int userID = -1; // whatever
PredicateExpression expression = new PredicateExpression(CustomersFields.UserId == userID); EntityCollection customers = new EntityCollection();
IPrefetchPath2 path = new PrefetchPath2((int) EntityType.CustomersEntity); path.Add(CustomersEntity.PrefetchPathAccounts);
path.Add(CustomersEntity.PrefetchPathCountries); path.Add(CustomersEntity.PrefetchPathCustomerAccounts). SubPath.Add(CustomerAccountsEntity.PrefetchPathAccounts). SubPath.Add(AccountsEntity.PrefetchPathTaxAccounts). SubPath.Add(TaxAccountsEntity.PrefetchPathTaxes);
using (DataAccessAdapter adapter = new DataAccessAdapter()){ adapter.FetchEntityCollection(customers, new RelationPredicateBucket(expression), 1, null, path); }
// now do something with the collection
let me know if you want some examples of other stuff.
fetching a customer based on PK is just as easy as
CustomersEntity customer = new CustomersEntity(customerID); using(DataAccessAdapter adapter = new DataAccessAdapter()){ adapter.FetchEntity(customer); }
you use prefetch path to do the equiv of 'left outer joins'. i.e. it will get the other tables linked if available. you can use 'bucket.Relations.' to force an 'inner join' such that rows are only returned if everything exists. let me know if you want an example of this.
--
http://www.boxofgoodfeelings.com/
http://lets.coozi.com.au/ |
| |
|
|