Giter Club home page Giter Club logo

Comments (3)

Emasoft avatar Emasoft commented on September 13, 2024 2

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.

from sqlite-net.

peterhuene avatar peterhuene commented on September 13, 2024

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.

from sqlite-net.

Emasoft avatar Emasoft commented on September 13, 2024

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;
    }
}

                }

from sqlite-net.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.