lundi 31 août 2015

C# SQLite Universal App Insert error Argument 1: cannot convert from 'MemBrainz.MainPage.Mood' to 'System.Collections.IEnumerable'

I've got this code, and it keeps coming up with the same error. Basically, I want to add "1" to the database under CurrentMood when the button is clicked. I'm getting: Argument 1: cannot convert from 'MemBrainz.MainPage.Mood' to 'System.Collections.IEnumerable'

Here's my code

public  class Mood
        {

            public int Id { get; set; }
            public int CurrentMood { get; set; }
        }

        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            greetingOutput.Text = "1";


            Mood mood1 = new Mood()
            {

This is where the error is

CurrentMood = 1

            };
            SQLite.SQLiteAsyncConnection addconn = new SQLite.SQLiteAsyncConnection("mood.db");
            await addconn.InsertAllAsync(mood1);
        }
    }

Aucun commentaire:

Enregistrer un commentaire