Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/csharp/287.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/wix/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C# 但是?只是一个猜测,但是试着把它设置为“pessoaId”?@SvenGrosen我会读的,谢谢你的提示。关于钥匙,我试过了,但还是有同样的错误,不过还是谢谢你。这不是问题所在。问题是Coletor类需要一个pessoaId才能成为Pessoa类中的另一个_C#_Linq_Windows Phone 8_Linq To Sql - Fatal编程技术网

C# 但是?只是一个猜测,但是试着把它设置为“pessoaId”?@SvenGrosen我会读的,谢谢你的提示。关于钥匙,我试过了,但还是有同样的错误,不过还是谢谢你。这不是问题所在。问题是Coletor类需要一个pessoaId才能成为Pessoa类中的另一个

C# 但是?只是一个猜测,但是试着把它设置为“pessoaId”?@SvenGrosen我会读的,谢谢你的提示。关于钥匙,我试过了,但还是有同样的错误,不过还是谢谢你。这不是问题所在。问题是Coletor类需要一个pessoaId才能成为Pessoa类中的另一个,c#,linq,windows-phone-8,linq-to-sql,C#,Linq,Windows Phone 8,Linq To Sql,但是?只是一个猜测,但是试着把它设置为“pessoaId”?@SvenGrosen我会读的,谢谢你的提示。关于钥匙,我试过了,但还是有同样的错误,不过还是谢谢你。这不是问题所在。问题是Coletor类需要一个pessoaId才能成为Pessoa类中的另一个键。无论如何,谢谢你。 using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Data.Linq.M


但是?只是一个猜测,但是试着把它设置为“pessoaId”?@SvenGrosen我会读的,谢谢你的提示。关于钥匙,我试过了,但还是有同样的错误,不过还是谢谢你。这不是问题所在。问题是Coletor类需要一个pessoaId才能成为Pessoa类中的另一个键。无论如何,谢谢你。
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;

namespace Aplicativo_Windows_Phone
{
    #pragma warning disable 0169, 0649
    [Table(Name="Pessoas")]
    public class Pessoa
    {
        [Column(IsDbGenerated = true, IsPrimaryKey = true)]
        public int Id { get; set; }

        [Column]
        public string Nome { get; set; }

        [Column]
        public string Email { get; set; }

        [Column]
        public string Senha { get; set; }

        [Column]
        public string Profissao { get; set; }

        [Column]
        public int Idade { get; set; }

        [Column]
        public string Endereco { get; set; }

        [Column]
        public string Cidade { get; set; }

        [Column]
        public string Estado { get; set; }

        [Column(IsPrimaryKey = true, Name = "Coletor")]
        private int? coletorId;

        private EntityRef<Coletor> _coletor = new EntityRef<Coletor>();

        [Association(Name = "FK_Pessoas_PessoaColetores", IsForeignKey = true, Storage = "_coletor", ThisKey = "coletorId")]
        public Coletor Coletor
        {
            get { return _coletor.Entity; }
            set { _coletor.Entity = value; }
        }

        private EntitySet<PessoaColetor> _pessoaColetores = new EntitySet<PessoaColetor>();

        [Association(Name = "FK_PessoaColetores_Pessoa", Storage = "_pessoaColetores", OtherKey = "pessoaId", ThisKey = "Id")]
        private ICollection<PessoaColetor> PessoaColetores
        {
            get { return _pessoaColetores; }
            set { _pessoaColetores.Assign(value); }
        }

        public ICollection<Coletor> Coletores
        {
            get { return (from pc in PessoaColetores select pc.Coletor).ToList(); }
        }


    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using Microsoft.Phone.Data.Linq;
using Microsoft.Phone.Data.Linq.Mapping;

namespace Aplicativo_Windows_Phone
{
#pragma warning disable 0169, 0649
    [Table(Name="Coletores")]
    public class Coletor
    {
        [Column(IsPrimaryKey = true, IsDbGenerated = true)]
        public int Id { get; set; }

        [Column]
        public float Latitude { get; set; }

        [Column]
        public float Longitude { get; set; }

        [Column]
        public string Nome { get; set; }

        private EntitySet<PessoaColetor> _pessoaColetores = new EntitySet<PessoaColetor>();
        [Association(Name = "FK_PessoaColetores_Coletor", Storage = "_pessoaColetores", ThisKey = "Id", OtherKey = "coletorId")]
        private ICollection<PessoaColetor> PessoaColetores
        {
            get { return _pessoaColetores; }
            set { _pessoaColetores.Assign(value); }
        }



        [Column(IsPrimaryKey = true, Name = "Ocorrencias")]
        private int? ocorrenciaId;

        private EntityRef<Ocorrencia> _ocorrencia = new EntityRef<Ocorrencia>();

        [Association(Name = "FK_Coletores_ColetorOcorrencias", IsForeignKey = true, Storage = "_ocorrencia", ThisKey = "ocorrenciaId")]
        public Ocorrencia Ocorrencia
        {
            get { return _ocorrencia.Entity; }
            set { _ocorrencia.Entity = value; }
        }

        private EntitySet<ColetorOcorrencia> _coletorOcorrencias = new EntitySet<ColetorOcorrencia>();

        [Association(Name = "FK_ColetorOcorrencias_Coletor", Storage = "_coletorOcorrencias",ThisKey = "Id", OtherKey = "coletorId")]
        private ICollection<ColetorOcorrencia> ColetorOcorrencias
        {
            get { return _coletorOcorrencias; }
            set { _coletorOcorrencias.Assign(value); }
        }

        public ICollection<Pessoa> Pessoas
        {
            get { return (from pc in PessoaColetores select pc.Pessoa).ToList(); }
        }

        public ICollection<Ocorrencia> Ocorrencias
        {
            get { return (from co in ColetorOcorrencias select co.Ocorrencia).ToList(); }
        }
    }
}


using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Linq.Mapping;
using System.Data.Linq;
using Microsoft.Phone.Data.Linq;
using Microsoft.Phone.Data.Linq.Mapping;

namespace Aplicativo_Windows_Phone
{
#pragma warning disable 0169, 0649
    [Table(Name = "PessoaColetores")]
    class PessoaColetor
    {
        [Column(IsPrimaryKey = true, Name = "Coletor")]
        private int coletorId;
        private EntityRef<Coletor> _coletor = new EntityRef<Coletor>();
        [Association(Name = "FK_PessoaColetores_Coletores", IsForeignKey = true, Storage = "_coletor", ThisKey = "coletorId")]
        public Coletor Coletor
        {
            get { return _coletor.Entity; }
            set { _coletor.Entity = value; }
        }

        [Column(IsPrimaryKey = true, Name = "Pessoa")]
        private int pessoaId;
        private EntityRef<Pessoa> _pessoa = new EntityRef<Pessoa>();
        [Association(Name = "FK_PessoaColetores_Pessoas", IsForeignKey = true, Storage = "_pessoa", ThisKey = "pessoaId")]
        public Pessoa Pessoa
        {
            get { return _pessoa.Entity; }
            set { _pessoa.Entity = value; }
        }
    }
}
[Column(IsPrimaryKey = true, Name = "Coletor")]
    private int? coletorId;
[Column(IsForeignKey= true, Name = "Coletor")]
    private int? coletorId;