| Julius's profileJulius Ganns . netzkernPhotosBlogNetwork | Help |
|
March 23 Performing Updates with the DataTransferObjectManagerIn a previous post we took a look at an early preview version of the DataTransferObjectManager, a library we developed at netzkern to integrate WCF with O/RM tools. Today we will take a look at how nk.DTOM solves the problem of mapping updates from clients to entity objects. Here is how to do this: // This object represents an update request from an external client. // Read the corresponding entity from the data source. // Map the properties of the DTO to the entity. // Update the data source. Pretty straight forward, right? Remember, by default nk.DTOM only maps value type properties from the source object to the destination object, and that’s exactly what we need here. Now, let’s consider our entity “houseEntity” contains a property that should be readonly for external clients. In our case, the price of our house is fix and we don’t want it to be changed. In this case, we use the support for selective updates in nk.DTOM. The “Map”-Method contains a fourth parameter that allows us to specify certain properties that we want to preserve in the destination object. By combining the third and the fourth parameter, nk.DTOM even enables us to update certain values of complete graphs of entity objects. We just need to preserve the original reference to the entity object and maybe some other properties. Take a look: // Update a referenced DTO on the client-side. // Create a PropertyPathCollection on the server-side that allows the client to update the referenced entity “Person” in the property “Owner” as well. The service developer can even decide which properties can be changed based on the identity of the caller, for example by relying on WCF authentication features. We’re currently planning to release netzkern.DataTransferObjectManager as part of a small toolkit on CodePlex. We hope, you’re going to use and like it. March 01 Top 10 Must-Read Books for Personal SuccessI love reading books. Usually that means one, sometimes two or three books per week. In the last four years I extended my personal library to several self-development and management books and I have to say, I’m glad that I read most of them. Below you can find my personal top ten list in those two categories: Getting Things Done Additionally I own several other books that I haven’t read yet but that might make it to this list, maybe even replacing one or two of the ones listed above. Here are those I’m eager to read: Think And Grow Rich For a complete list of all my books, please visit my website at www.juliusganns.com. |
|
|