S
shapper
Hello,
I have a XML file as follows:
<Posts>
<Post>
<Id>1</Id>
<Title>Asp.NET MVC</Title>
<Body>Some stuff</Body>
<Created>10-10-2008</Created>
<Tags>
<Tag>Asp.Net</Tag>
<Tag>MVC</Tag>
</Tags>
</Post>
</Posts>
Or I could use 3 tables (Posts, PostsTags and Tags):
<Posts>
<Post>
<PostId>1</PostId>
<Title>Asp.NET MVC</Title>
<Body>Some stuff</Body>
<Created>10-10-2008</Created>
</Post>
</Posts>
<Tags>
<Tag>
<TagId>1</TagId>
<Name>Asp.NET</Name>
</Tag>
<Tag>
<TagId>2</TagId>
<Name>Mvc</Name>
</Tag>
</Tags>
<PostsTags>
<PostTag>
<PostId>1</PostId>
<TagId>1</TagId>
</PostTag>
<PostTag>
<PostId>1</PostId>
<TagId>2</TagId>
</PostTag>
</PostsTags>
Basically this replicates the SQL database tables.
Then I get the data into objects using Linq and joins on the XML files
or not?
Which approach do you use when working with XML files?
Basically sometimes I have a project where an SQL server database is
"to much" and the client does want to pay the extra money for the SQL
Server hosting. So I use XML files.
I am not sure if I should use the first option where I just use a
"Flat" format as usual in XML files or use the second approach to try
to replicate the database tables.
I am using Linq and C# for this.
Thanks,
Miguel
I have a XML file as follows:
<Posts>
<Post>
<Id>1</Id>
<Title>Asp.NET MVC</Title>
<Body>Some stuff</Body>
<Created>10-10-2008</Created>
<Tags>
<Tag>Asp.Net</Tag>
<Tag>MVC</Tag>
</Tags>
</Post>
</Posts>
Or I could use 3 tables (Posts, PostsTags and Tags):
<Posts>
<Post>
<PostId>1</PostId>
<Title>Asp.NET MVC</Title>
<Body>Some stuff</Body>
<Created>10-10-2008</Created>
</Post>
</Posts>
<Tags>
<Tag>
<TagId>1</TagId>
<Name>Asp.NET</Name>
</Tag>
<Tag>
<TagId>2</TagId>
<Name>Mvc</Name>
</Tag>
</Tags>
<PostsTags>
<PostTag>
<PostId>1</PostId>
<TagId>1</TagId>
</PostTag>
<PostTag>
<PostId>1</PostId>
<TagId>2</TagId>
</PostTag>
</PostsTags>
Basically this replicates the SQL database tables.
Then I get the data into objects using Linq and joins on the XML files
or not?
Which approach do you use when working with XML files?
Basically sometimes I have a project where an SQL server database is
"to much" and the client does want to pay the extra money for the SQL
Server hosting. So I use XML files.
I am not sure if I should use the first option where I just use a
"Flat" format as usual in XML files or use the second approach to try
to replicate the database tables.
I am using Linq and C# for this.
Thanks,
Miguel