NuGet packages do not include Extension Methods

Issue #84 new
Jon created an issue

I picked up this library on NuGet the other day and attempted to use various extension methods such as GetAllWithChildren / InsertWithChildren / etc. However inside the NuGet package, these items do not seem to be included(Yet they show up in the object explorer). I then decided to pull down the source and directly reference the projects to which this worked seamlessly.

I would like to propose that the PCL package be updated to include all of these extensions to be used out of the gates. I read a few forum posts regarding this item, and it seems that there's talk about these items being included only in the MVVMCross plugin and not for other types (Such as native projects Xamarin.iOS / Xamarin.Android).

Seeing as this was my first experience with this extension, I would love to help in anyway I can to assist in these efforts as after I was able to overcome some hurdles, the benefit of this library is quite great!

Source: http://www.bhyuu.com/sqlite-net-extensions-example-on-xamarin-forms/

http://forums.xamarin.com/discussion/20117/sqlite-net-extensions-and-sqliteconnection#latest

Comments (4)

  1. Guillermo GutiƩrrez

    PCL package include those methods. Are you sure you included the required namespace?

    using SQLiteNetExtensions.Extensions;
    

    Make sure that you are not including two different versions of sqlite-net package.

    Take a look at the integration tests project for some working samples.

  2. Jon reporter

    Thanks for the comment. I took the package directly from Nuget which installs the dependency of Sqlite.Net 3.0.5. Even attempting to use that namespace these extension methods do not appear in Intellisense / etc. Thus why I took the code as a hard dependency and added the projects to my references which did allow the use of these items. Thus I believe there might be an issue with the Nuget packages as it seems I might not be the only one experiencing it. I'll dig into it later tomorrow, but figured I'd bring it up to your attention.

  3. mattia pagini

    i think i have a problem related with this. I have a Xamarin Forms shared project. I added this library and the extension one. i'm creating my connection in this way in Xamarin.Android :

    var conn = new SQLiteConnection(new SQLite.Net.Platform.XamarinAndroid.SQLitePlatformAndroid(), path);
    

    Then in my shared project i'm not able to find the extension methods:

    conn.GetAllWithChildren
    or
    conn.InsertWithChildren
    

    What can i do? i dont know how to add them as hard dependency as Jonathan said, i'm pretty new to Xamarin and C# in general. Thanks

  4. mattia pagini

    Ok, maybe i've found a solution. in my shared project i have those 2 nuget package:

    https://www.nuget.org/packages/SQLite.Net-PCL
    https://www.nuget.org/packages/SQLiteNetExtensions/
    

    In my DAO class i've added

    using SQLiteNetExtensions.Extensions;
    

    manually, because IntelliSense is not able to find them automatically. Now i can use the extension method of this library in my xamarin shared project.

  5. Log in to comment