You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to castle-pro...@googlegroups.com
I have an ActiveRecord class, let's call it MyClass, that's set Lazy=true at the class level. When I call ActiveRecordMediator<MyClass>.FindByPrimaryKey(0), I get back a MyClass proxy object (since id 0 doesn't exist). I guess I would expect to get a null but I can see why I get a proxy. My question is how the heck do I check if that record actually existed? Right now, as soon as I access any property on the returned proxy object, I get an ObjectNotFoundException.
Help!
tim
Tim Schmidt
unread,
Apr 4, 2012, 4:23:09 PM4/4/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to castle-pro...@googlegroups.com
Follow up question, in this case I don't really even care to lazy load. Can I bypass that behavior for this one call?
Alessandro Cavalieri
unread,
Apr 12, 2012, 11:38:32 AM4/12/12
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to castle-pro...@googlegroups.com
If I remember well FindByprimaryKey has an overload:
public static object FindByPrimaryKey(Type targetType, object id, bool throwOnNotFound);
with the overload you can specify the action when the record doesn't exist.