Port80 Forums Fast Hit Web Hosting

Our Platinum Sponsors:


Go Back   Port80 Forums > Development & Code > dotNet & ASP

Reply
 
Thread Tools Display Modes
  #1  
Old 23-11-2010, 12:49 PM
thezeski thezeski is offline
Member
 
Join Date: Mar 2010
Location: Perth
Posts: 87
thezeski is on a distinguished road
Default (EDM issue) Mapping entity to XML and Sql

Hi guys



I'm writing an application that needs to map two different stores into different properties of the same entity.

Basically, we have a CMS that exposes a file list PDF's via a web service. We have to send it an XML request and the response contains the data that needs to be parsed into each entity.

I'm not sure how to modify the model in this way though. I can think of two ways to handle this,

1. Create a new Schema in the EDMX file that uses something like the System.Xml.Provider for each different request type/result set

2. Write a partial class for the Entity and populate all the unmapped fields using serialized XML

I'm actually unsure if there is a better way to go about this... so if you know one please let me know. This is my first MVC 2 project and so I'm not completely up to speed on all the concepts/best practise.



Cheers!
Paul
__________________
Paul Brzeski
http://www.paulbrzeski.com
Reply With Quote
  #2  
Old 24-11-2010, 09:59 AM
thezeski thezeski is offline
Member
 
Join Date: Mar 2010
Location: Perth
Posts: 87
thezeski is on a distinguished road
Default

In case anyone wonders...

I've written it to use EDM as the main storage and a partial class adds the extra properties to each entity. I then treated created a few classes to communicate with the web service and expose the data via LINQ.... an interface for the main entities then performs a LINQ join and returns the entity the way I want.

Just thought I'd share
__________________
Paul Brzeski
http://www.paulbrzeski.com
Reply With Quote
  #3  
Old 25-11-2010, 08:25 AM
deprecated-cruelty deprecated-cruelty is offline
Senior Member
 
Join Date: Feb 2003
Location: Huntingdale, Perth
Age: 38
Posts: 2,084
deprecated-cruelty is on a distinguished road
Default

Thanks Paul...would be interesting to see the solution as well if at all possible?
__________________
www.sqlserver.org.au - SQL UG Australia www.msmvps.com/blogs/brianmadsen - blog
Microsoft MVP Visual Developer - ASP/ASP.Net
Reply With Quote
  #4  
Old 09-12-2010, 04:41 PM
thezeski thezeski is offline
Member
 
Join Date: Mar 2010
Location: Perth
Posts: 87
thezeski is on a distinguished road
Default

Sorry for the silence, will post something up when I get a chance to 'anonymize' the code.
__________________
Paul Brzeski
http://www.paulbrzeski.com
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +8. The time now is 10:33 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2014, Jelsoft Enterprises Ltd.