views:

81

answers:

1

Lets say i have this database design:

Items
  Id
  Name
  Desc

ItemTags
  ItemId
  TagId

Tags
  Id
  Tag

And i want to map it to the following class

class Item
  int Id
  string Name
  string Desc
  IList<string> Tags

Please note that I don't want to declare class Tag, i just want the Item class to have list of strings that represent tags.

Is it possible ?

A: 

Why dont you want a Tag class?it will be strongly typed and alot easier to implement... Ref:

IList< Tag> Tags;

override the ToString() to write the "Tag" property if that makes it better..

ThorHalvor
I don't want the Tag type since I don't see what value does it brings. It will be just a wrapper around string with no real value. Also, since I will need to expose my types to COM it will add to the complexity.
Alex Reitbort