SisoDb – v3.0 – Now with specific provider assemblies

Since v3.0 SisoDb now has specific provider assemblies. This is the result of me started with a provider for SQLCE4. As a result of this the NuGet-package for the provider for SQL2008 is now located at: http://nuget.org/List/Packages/SisoDb.SQL2008 The old package will remain public for a while.

The bigest change is that the SqlDbFactory now is called Sql2008DbFactory. Read the docs for more info: http://sisodb.com/Docs/Doc19

Fixed bug
QxAny (http://sisodb.com/Docs/Doc7) now can be used on nested enumerables but it only support operators: (== and !=), if non supported operator is used, a SisoDbException will be thrown.

[Test]
public void Query_WithQxAny_WhenQxAnyOnQxAnyIsUsedWithAndNotEqOperator_ReturnsCorrectMatch()
{
    var roots = CreateRoots();

    using (var uow = Database.CreateUnitOfWork())
    {
        uow.InsertMany(roots);
        uow.Commit();

        var refetched = uow.Where<Root>(m => m.Child.Items.QxAny(i => i.Values.QxAny(i2 => i2 != 42 && i2 != 142))).ToList();

        Assert.AreEqual(1, refetched.Count);
        Assert.AreEqual("ChildTwo", refetched[0].Child.Name);
        Assert.AreEqual(20, refetched[0].Child.Items[0].Value);
        Assert.AreEqual(21, refetched[0].Child.Items[1].Value);
    }
}

private static IList<Root> CreateRoots()
{
    var roots = new[] { new Root(), new Root() };

    roots[0].Child.Name = "ChildOne";
    roots[0].Child.Items.Add(new Item { Value = 10 });
    roots[0].Child.Items.Add(new Item { Value = 11, Values = new[] { 42, 142 } });

    roots[1].Child.Name = "ChildTwo";
    roots[1].Child.Items.Add(new Item { Value = 20 });
    roots[1].Child.Items.Add(new Item { Value = 21, Values = new[] { 43, 143 } });

    return roots;
}

public class Root
{
    public Guid SisoId { get; set; }

    public FirstLevelChild Child { get; set; }

    public Root()
    {
        Child = new FirstLevelChild();
    }
}

public class FirstLevelChild
{
    public string Name { get; set; }

    public List<Item> Items { get; set; }

    public FirstLevelChild()
    {
        Items = new List<Item>();
    }
}

public class Item
{
    public int Value { get; set; }

    public int[] Values { get; set; }
}

//Daniel

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s