0
I have a class called Chamber
[Table("Camara")]
public class Camara
{
[Key]
public int CamaraId { get; set; }
[Display(Name = "Nome")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[StringLength(50, MinimumLength = 2, ErrorMessage = "O campo {0} deve ter no mínimo {2} e no máximo {1} caracteres.")]
public string Nome { get; set; }
}
I have the class called Tipo Lado
[Table("TipoLado")]
public class TipoLado
{
[Key]
public int TipoLadoId { get; set; }
[Display(Name = "Nome")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[StringLength(50, MinimumLength = 2, ErrorMessage = "O campo {0} deve ter no mínimo {2} e no máximo {1} caracteres.")]
public string Nome { get; set; }
}
I want to include this the list of Cameras items to be viewed in another class called Sequence if not mapped by Entity Frameworks.
public class Sequencia
{
public Sequencia()
{
DataAbate = DateTime.Now;
}
[Key]
public int SequenciaId { get; set; }
[Display(Name = "Data do Abate")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[DisplayFormat(ApplyFormatInEditMode = true, DataFormatString = "{0:yyyy-MM-dd}")]
[DataType(DataType.Date)]
public DateTime DataAbate { get; set; }
[Display(Name = "Lote")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
public int Lote { get; set; }
[Display(Name = "Numero Sequencia")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[Range(1, double.MaxValue, ErrorMessage = "Favor Digitar um {0} maior que zero!")]
public int NumeroSequencia { get; set; }
[Display(Name = "Lado A")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[Range(1, double.MaxValue, ErrorMessage = "Selecione o {0} corretamente!")]
public int LadoA { get; set; }
[Display(Name = "Câmara Lado A")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[Range(1, double.MaxValue, ErrorMessage = "Selecione o {0} corretamente!")]
public int CamaraLadoA { get; set; }
[Display(Name = "Lado B")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[Range(1, double.MaxValue, ErrorMessage = "Selecione o {0} corretamente!")]
public int LadoB{ get; set; }
[Display(Name = "Câmara Lado B")]
[Required(ErrorMessage = "O Campo {0} é requirido!")]
[Range(1, double.MaxValue, ErrorMessage = "Selecione o {0} corretamente!")]
public int CamaraLadoB { get; set; }
[NotMapped]
public List<Camara> CamaraList { get; set; }
}
Rectifying the question I have two screens One that registers Cameras and the other Type
On the Sequence screen I choose the Camera where the Side A or B is and the Type that is the Side A and the Side B is
Index I want the names of the selected items to appear
Why do you need the EPH No Mother? I ask this because maybe what you want to do, is not to be done in the entity but in any service.
– Rodrigo K.B
@Rodrigok. B as you said I want to do any job, is that I want Sequencia to include the Camera table in Sequenciacontroller. would pass this scheme ?
– Cyberlacs
Does Sequencia have any connection with camera? I’ll give you an answer about what I think you should do for what I understand of your problem. Anything you can say will make me feel better.
– Rodrigo K.B
@Rodrigok. B is the following Sequence has connection with Camera yes, the problem is that in Sequence I have two fields (Side A) and (Side B) that are each, a Dropdownlist that shows the name of the Camera and that takes Camera their respective ID and now I want in Index and Detail show instead of the ID show the names of the Cameras, understood ?
– Cyberlacs
Get it, see my answer if it helps you, and comment on me to improve for you, I see that maybe you need a third class yet.
– Rodrigo K.B
@Rodrigok. B you could send me a contact by email to be able to exemplify this question better, if not give comment yes or no blz ? Negative I delete this message blz
– Cyberlacs
include the details in your question
– Rodrigo K.B
Let’s go continue this discussion in chat.
– Cyberlacs
@Rodrigok. B corrected the question, now I am explaining better my need.
– Cyberlacs