csharp
using VelocityDb;
using VelocityDb.Collection.BTree;
using VelocityDb.Session;
public class Customer : OptimizedPersistable
{
public int Id { get; set; }
public string Name { get; set; }
public BTreeSet<Address> Addresses { get; set; }
}
public class Address : OptimizedPersistable
{
public string Street { get; set; }
public string City { get; set; }
public string Country { get; set; }
}
public class Program
{
static void Main(string[] args)
{
using (var session = new SessionNoServer("path/to/database"))
{
session.BeginUpdate();
var customer = new Customer
{
Id = 1,
Name = "John Doe",
Addresses = new BTreeSet<Address>
{
new Address { Street = "123 Main St", City = "Example City", Country = "Example Country" },
new Address { Street = "456 Elm St", City = "Sample City", Country = "Sample Country" }
}
};
session.Persist(customer);
session.Commit();
}
}
}