views:

42

answers:

1

Hi,

Is anyone aware of a C# library that provide a means to manage a Web like map of items, which each item can have relationships to other items in the collection/table. As an example an implementation of this with a datastore might see the schema looking like the below. Picture a page with node objects scattered across it with lines going between them in a non-hierachal sense, with the lines have one arrow head (implying the parent-child relationship). So a node can have multiple parents, and multiple children.

> Table: Nodes 
> - ID
> - Description
> - etc
> 
> Table: Relationships
> - ParentNodeID
> - ChildNodeID

The library would have API methods such as:

  • AddParent(parent)
  • AddChild(child, parent)
  • GetChildren(item)
  • GetRootParent(item)
  • Delete(item)
  • etc

As an example of the complexity, the "Delete(item)" method would need to "walk the tree" so to speak and have the smarts to know which nodes it can delete depending on whether that node itself actually has another parent item somewhere which it references.

Ideally the library would support ADO.net for persisting it to database (in fact I'm using SQLite).

Anyone come across such a library?

Thanks

A: 

http://sqlite.phxsoftware.com/

  • Complete ADO.NET 2.0 Implementation
  • Support for the ADO.NET 3.5 Entity
  • Framework Visual Studio 2005/2008 Design-Time Support

Edit: I am using this for a while no issues at all.

Aseem Gautam
I'm using this for ADO.net on SQLite already - what I'm really after is implemented APIs for the map collection type topology I described
Greg
Did you looked into relationships in ADO.NET Datasets?. Pretty much of the parent child relations are covered there already. You will have to customize it as per your needs.
Aseem Gautam
Yes - that's what I've been using as a base. But as I've had to build my own "walk the tree" type methods it occurs to me that there must be libraries that people have already written, but whether in c#?
Greg