Service Stack ORMLite Many-To-Many Mappings

Option 1: Take Advantage of the Built In Serialization and Serialize the List

Code Snipped taken from Stack Overflow:

It's not implicitly handled automatically for you behind the scenes if that's what you mean? But as OrmLite is just a thin wrapper around ADO.NET interfaces anything is possible.

In OrmLite, by default every POCO maps 1:1 with a table. So if you wanted the table layout you would create it just as it looks in your database, e.g.

var article = new Article { ... };
var tag = new Tag { ... };
var articleTag = new ArticleTag { ArticleId = article.Id, TagId = tag.Id };
db.Insert(article, tag, articleTag);

Although you might want to take advantage of the built-in blobbing in OrmLite where any complex type just gets serialized and stored in a single text field. So you could do something like:

var article = { new Article { Tags = { "A","B","C" } };

Where Tags is just a List and OrmLite will take care of transparently serializing it in the database field for you.

Option 2: Create a conventional Many-To-Many Relationship Using a DB Table

See: Example 1 on Stack Overflow or Example 2 on Stack Overflow