Open Emasoft opened 12 years ago
Looks related to some recent changes having to do with column mappings. Could you include the property definition for MyVocabEntry.Word (including any attributes)? Perhaps that might shed some light on the issue.
Ok, thanks. Here is the MyVocabEntry class:
public class MyVocabEntry
{
[PrimaryKey, AutoIncrement]
public int ID { get; set; }
[Indexed]
public int EntryIndex { get; set; }
public string StemLemma { get; set; }
public string Etimology { get; set; }
[Indexed]
public string Word { get; set; }
public string PartOfSpeech { get; set; }
public string Morphology { get; set; }
public string Definitions { get; set; }
[Indexed]
public string Synonyms { get; set; }
[Indexed]
public string Antonyms { get; set; }
public override bool Equals (object obj)
{
if (obj is MyVocabEntry) {
return this.GetHashCode() == obj.GetHashCode();
} else {
return base.Equals(obj);
}
}
public override string ToString ()
{
return string.Format ("[MyVocabEntry]") + "," + EntryIndex + "," +Word + "," + StemLemma;
}
public override int GetHashCode ()
{
unchecked
{
int result = 37; // prime
result *= 397; // also prime
if (EntryIndex != 0)
result += EntryIndex.ToString().GetHashCode();
result *= 397;
if (Word != null)
result += Word.GetHashCode();
result *= 397;
if (StemLemma != null)
result += StemLemma.GetHashCode();
return result;
}
}
}
I solved the problem. In MonoTouch you need to add the "Serializable" and "Preserve All Members" attributes before the class declarations, otherwise the compiler removes some properties metadata at compile time:
[Serializable]
[Preserve(AllMembers=true)]
public class MyVocabEntry
{
...
}
I suggest you to add this info to the documentation wiki, I wasted a lot of time on this. Now it works beautifully. Great library.
In Monotouch, I get this error using SQLite-net:
This is the code:
the error is in this lines of SQLite.cs (MonoDevelop stops on the FindColumnWithPropertyName line):