ForeignKey Shared Project

Hi everyone, I've already looked for a solution in the forum, but still couldn't solve my problem..

I've a multi-platform shared project and already add the SQLite.cs to my project..
Now I've to use a foreignkey for a table, but can't use ForeignKey..

using System;
using SQLite;

using Xamarin.Forms;

namespace fitdiary
{
public class allenamentoItem
{
public allenamentoItem ()
{
}

    [PrimaryKey, AutoIncrement]
    public int ID { get; set; }

    public string Name { get; set; }

    public string NumAll { get; set; }

    public string Data { get; set; }

    public string Durata { get; set; }

    public string Note { get; set; }
}

}

using System;
using SQLite;
using System.Reflection;

using Xamarin.Forms;

namespace fitdiary
{
public class esItem
{
public esItem ()
{
}

    [PrimaryKey, AutoIncrement]
    public int ID { get; set; }

    public string Allenamento { get; set; }

    public string Name { get; set; }

    public string Kg { get; set; }

    public string Serie { get; set; }

    public string Rep { get; set; }

    public string Km { get; set; }

    public string Tempo { get; set; }

    public string Note { get; set; }

    [ForeignKey(typeof(allenamentoItem))]          //can't use this instruction
    public int AccountId { get; set; }

}

}

I've read that in PCL you've to download sql-net, but what about shared project??

Sign In or Register to comment.