tag:blogger.com,1999:blog-7740113442922996729.post2089159077845766341..comments2023-12-06T18:27:26.458+08:00Comments on Adrian's Developer Blog: ObjectContainerDataSource, FormViews and LLBLGen EntitiesAdrian Brownhttp://www.blogger.com/profile/09197663107306500241noreply@blogger.comBlogger10125tag:blogger.com,1999:blog-7740113442922996729.post-32463657900348777332010-02-02T09:58:32.633+11:002010-02-02T09:58:32.633+11:00Good fill someone in on and this mail helped me al...Good fill someone in on and this mail helped me alot in my college assignement. Thank you for your information.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-49250160621079538722009-02-04T08:17:00.000+08:002009-02-04T08:17:00.000+08:00Good work. Just post I needed. I have issue with a...Good work. Just post I needed. I have issue with abstract classes and inheritance.<BR/><BR/>TNXMilan Jarichttps://www.blogger.com/profile/03010220145652681236noreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-1369345342894497232008-07-31T12:06:00.000+08:002008-07-31T12:06:00.000+08:00Adrian, thanks for sharing this with the community...Adrian, thanks for sharing this with the community.<BR/><BR/>In the following thread I share some insights about the behavior discussed in your post:<BR/><BR/>http://www.codeplex.com/websf/Thread/View.aspx?ThreadId=32461<BR/><BR/>This may clarify why we did the ObjectContainerDataSource the way it is.<BR/><BR/>Cheers,<BR/>Mariano SzklannyAnonymousnoreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-66020678099405875192008-05-27T13:05:00.000+08:002008-05-27T13:05:00.000+08:00Hi Andrew,I haven't looked at this for a while, bu...Hi Andrew,<BR/><BR/>I haven't looked at this for a while, but I am thinking that the line:<BR/><BR/>TypeDescriptionHelper.BuildInstance(keys, instance);<BR/><BR/>can be moved up to the line after the instance is created. i.e.:<BR/><BR/>instance = CreateInstance();<BR/>TypeDescriptionHelper.BuildInstance(keys, instance);<BR/><BR/>If the instance is not being constructed, the keys shouldn't be updated anyway.<BR/><BR/>Hope this helps.<BR/><BR/>Cheers,<BR/>Adrian.Adrian Brownhttps://www.blogger.com/profile/09197663107306500241noreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-4141158020525796282008-05-26T22:58:00.000+08:002008-05-26T22:58:00.000+08:00Adrian - marvellous work with these amendments. Th...Adrian - marvellous work with these amendments. The "Update" version is working perfectly for me.<BR/><BR/>However I have an issue with your version of ExecuteDelete(), at line:<BR/><BR/>TypeDescriptionHelper.BuildInstance(keys, instance);<BR/><BR/>I am getting the exception:<BR/><BR/>The property 'ParentID' is part of the object's key information and cannot be modified.<BR/><BR/>"ParentID" is named as my object's key. It seems that ExecuteDelete() is trying to insert a value for the object key, which the framework does not like...Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-32878092965499462582008-05-20T18:34:00.000+08:002008-05-20T18:34:00.000+08:00Hi Adrian,Thanks for getting back to me and thanks...Hi Adrian,<BR/><BR/>Thanks for getting back to me and thanks for the advice.<BR/><BR/>Yes, i thought about persisting the instance(s) that I got from the select method (using the ViewState for example), but I am wary of doing this - it should be the OCDS who does this sort of thing.<BR/><BR/>I agree that the Approve action is a domain specific action - it was not my intention to ask you (or anyone else) to add this specific method to OCDS.<BR/><BR/>I have also posed a similar question on codeplex (<A HREF="http://www.codeplex.com/websf/Thread/View.aspx?ThreadId=27963" REL="nofollow">Codeplex thread</A>). On there I describe the approach that I am taking: In summary, I am overloading the delete event to handle any other sort of events as well as delete (overloading is not accurate, bastardising is more accurate).gideonhttps://www.blogger.com/profile/04725201279342074808noreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-45491570536053261812008-05-20T13:49:00.000+08:002008-05-20T13:49:00.000+08:00Hi Gideon,Well, in the ObjectContainerDataSource's...Hi Gideon,<BR/><BR/>Well, in the <B>ObjectContainerDataSource's</B> implementation of <B>DataSourceView</B> there is a protected property called <B>Data</B> that contains a list of the objects managed by the view. In other words, the instances you are binding to. The standard actions (Select/Insert/Update/Delete) access this and find the instance based on key values. You could potentitally add functionality for other actions. However, an action such as Approve Record sounds very much like a business process, and I'm not sure I'd want to pollute the DataSource with this kind of thing. <BR/><BR/>I'd be inclined to keep it external to the datasource. You should have the instance anyway as you will have provided it to the <B>Selecting</B> event on postback.Adrian Brownhttps://www.blogger.com/profile/09197663107306500241noreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-87033770469914194402008-05-19T14:09:00.000+08:002008-05-19T14:09:00.000+08:00Good work. ObjectDataSourceContainer is a gem. Whe...Good work. <B>ObjectDataSourceContainer</B> is a gem. When I came across a similar problem I used the <B>DataKeyNames</B> approach, but I did not have a read only property to contend with. But thanks to your example, I now realise that you can look at the source of the WCSF.<BR/><BR/>With my usage of the <B>ObjectContainerDataSource</B>, I have moved past the 'non-trivial' and am left scratching my head in some situations. The example I want your opionion on is this:<BR/><BR/>Edit/Insert/Delete works all wonderfully, but what if you want to add a different type of action to the Data. In my example, I have a <B>DetailsView</B> where I have Edit/Insert/Delete all working, but now I want to support for a few other actions. Say, Approve Record. What I would really love is to be able to get at the Instance of the data bound object. I.e. for the <B>objectContainerDataSource_Updated</B> event, you get a nice <B>e.Instance</B> attribute to access.<BR/><BR/>I could just reconstruct the Object myself (like I have in the past) but there must be a nicer way, seeing as the <B>ObjectContainerDataSource</B> already does it though the <B>ObjectContainerDataSourceView</B> <B>.CreateInstance()</B>gideonhttps://www.blogger.com/profile/04725201279342074808noreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-74642019154688571812008-04-28T10:11:00.000+08:002008-04-28T10:11:00.000+08:00Yes, but you still can't push the Timestamp value ...Yes, but you still can't push the Timestamp value into the new entity instance as it is read-only.Adrian Brownhttps://www.blogger.com/profile/09197663107306500241noreply@blogger.comtag:blogger.com,1999:blog-7740113442922996729.post-80854069694747570032008-04-27T20:29:00.000+08:002008-04-27T20:29:00.000+08:00The ability to store the Timestamp value is taken ...The ability to store the Timestamp value is taken care of in the control you bind to. For example if you bind to a datagrid then you store the concurrency value in the DataKeyNames property (e.g. DataKeyNames="ID,Concurrency") of the datagrid.<BR/><BR/>You can then retrieve the Concurrency value on either the updating or updated event of the ObjectContainerDataSource.<BR/><BR/>__AllanAnonymousnoreply@blogger.com