Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feature: Title #607

Open
Vuyiswamb opened this issue Oct 13, 2020 · 0 comments
Open

feature: Title #607

Vuyiswamb opened this issue Oct 13, 2020 · 0 comments

Comments

@Vuyiswamb
Copy link

Good Day Everyone one

i have installed the following Packages in my Standard Project, Android and ios

SQLitePCLRaw.bundle_green
akavache.sqlite3

and i have static class with the following functions

public   static USERS_Model  RetrieveUserInfo()
        {
            USERS_Model Userinfo = null; 
            try
            {

                try
                {

                    Registrations.Start("mykey");  
                     BlobCache.LocalMachine.GetObject<USERS_Model>("userdata")
                    .Subscribe(x => Userinfo = x, ex => Console.WriteLine("No Key!"));

                }
                catch (KeyNotFoundException ex)
                {
                    Userinfo = new USERS_Model();
                } 
            }
            catch (Exception ex)
            {
                if (ex.Message.Contains("The given key 'userdata' was not present in the cache"))
                {
                    Userinfo = null;
                }
            }
            return Userinfo;
        }
public static  void StoreData(USERS_Model model)
       {
           if (USER_DATA != null)
           { 
               try
               {
                   Registrations.Start("mykey");
                   BlobCache.LocalMachine.InsertObject<USERS_Model>("userdata", model);


               }
               catch (KeyNotFoundException ex)
               {
                   throw ex;
               }
           }
       }

and have init on the platforms like this

Akavache.Sqlite3.Registrations.Start("mykey", () => SQLitePCL.Batteries_V2.Init());

When i save data and close the app and open it again , i dont get the data, it returns null , what could be the problem

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant