How to use EntityFrameworkCore.Sqlite with MvvmCross

iooovoltsiooovolts Member ✭✭

I was wondering if anyone knows how I could obtain the filepath needed from both Android and iOS so I could pass it into my Context class in order to store the file correctly.

I have been trying to find some sort of example/guide on using ef core sqlite while mvvmcross is present (with xamarin forms) and its proving to be quite the conundrum. The best video I could find of ef core sqlite is (link below). He does an excellent job however, as I am using Mvvmcross we start our application is different ways.

App class in Core project

    namespace TestApp.Core
    {
        public class AppCore : MvxApplication
        {
            public override void Initialize()
            {
                Mvx.IoCProvider.RegisterType<HttpClient>();
                Mvx.IoCProvider.RegisterType<ITestService, TestService>();
                //Mvx.IoCProvider.RegisterType(() => new TestContext("")); from here I don't know what to do
            //The context class by the way is expecting a string filepath to initialise a string field dbPath.

                RegisterAppStart<HomeViewModel>();
            }
        }
    }

Sign In or Register to comment.