tag:blogger.com,1999:blog-15136575.post8205267515428520325..comments2023-10-17T12:00:16.772+01:00Comments on Code rant: Repository.GetById using LINQ Expression SyntaxMike Hadlowhttp://www.blogger.com/profile/16441901713967254504noreply@blogger.comBlogger7125tag:blogger.com,1999:blog-15136575.post-48208180670459313452010-06-25T09:19:59.875+01:002010-06-25T09:19:59.875+01:00Very nice, just came across the same issue, you sa...Very nice, just came across the same issue, you saved me a lot of timeBryan Averyhttp://www.bryanavery.co.uknoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-35860203198153089932009-06-12T21:38:29.582+01:002009-06-12T21:38:29.582+01:00Hi Dreas,
In my case all my primary keys are ints...Hi Dreas,<br /><br />In my case all my primary keys are ints. If you want to use GUIDs, just change the code to check for them instead.Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-45314683174546718652009-06-12T16:22:03.766+01:002009-06-12T16:22:03.766+01:00Mike,
Why are you throwing an Exception if the Pr...Mike,<br /><br />Why are you throwing an Exception if the Primary Key is not of type int? What if you have a PK set as GUID (string) ?Andreas Grechhttps://www.blogger.com/profile/08461494359067314449noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-72917860195230123452008-09-24T15:35:00.000+01:002008-09-24T15:35:00.000+01:00Thank you, This was really useful to me......Thank you, This was really useful to me......Joji Thomashttps://www.blogger.com/profile/10846339034215852079noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-31703992348501654172008-06-23T02:26:00.000+01:002008-06-23T02:26:00.000+01:00Really helped me a lot and works like a charm. Tha...Really helped me a lot and works like a charm. ThanksAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-15136575.post-76177863989982255312008-05-22T11:15:00.000+01:002008-05-22T11:15:00.000+01:00Hi Anil,Thanks for the comment. In my opinion cach...Hi Anil,<BR/><BR/>Thanks for the comment. In my opinion caching should be the responsibility of the DAL. It's an infrastructure thing, and your Domain or Business Layer should simply be responsible for representing your domain rules.<BR/><BR/>LINQ-to-SQL does object caching for the lifetime of the DataContext, but then you've got to decide how long you want your DataContext hanging around for. In most web applications it would be a mistake have a lifetime beyond the request, which is probably not what you want.Mike Hadlowhttps://www.blogger.com/profile/16441901713967254504noreply@blogger.comtag:blogger.com,1999:blog-15136575.post-2775209600476252732008-05-22T10:11:00.000+01:002008-05-22T10:11:00.000+01:00Repository pattern discussed here is great.. Suppo...Repository pattern discussed here is great.. Suppose if we need to cache business objects... where do we handle caching? DAL or BIZ layer?<BR/><BR/>ThanksAnil Kumar T.Rhttps://www.blogger.com/profile/14826274660688994474noreply@blogger.com