I don't think that what you need is limited to your example but if it's just that... To answer your question you can just create a core Foo and put three fietds on it, one is the id and the other 2 are 2 multivalue fields that contains the Barid and the Bazid
[SolrUniqueKey("fooId")]
public string FooId{ get; set; }
[SolrField("barId ")]
public ICollection<string> BarId { get; set; }
[SolrField("bazId ")] // cat is a multiValued field
public ICollection<string> BazId { get; set; }
this will do for your example. But anything more complex that this is not easy to do in Solr and I would not suggest you try if you have no much experience with it.