4
Hello,
I have a Person Class and an Address Class
Ex.
public class Pessoa
{
public int Id { get; set; }
public string Nome { get; set; }
...
public Endereco Endereco { get; set; }
}
public class Endereco
{
public string Logradouro { get; set; }
public string Numero { get; set; }
...
}
When I run the Entityframework Update-Database an Address table with One to One relationship is generated, but the idea was that the address fields were part of the Person table without relationship, this is possible?
Ex. I would like the person table to have the fields Id, Nome, Logradouro, Numero.
It is possible to do this?
You generated
DbSet
forEndereco
?– Leonel Sanches da Silva
No, so I thought it wouldn’t generate the table..
– Alexandre Previatti
I did some research and from what it seemed to me is not possible to popular the models the way you want. But one question, why do you need it to be done that way?
– Zignd
@Zignd is possible yes, take a look at my answer.
– Joel Ramos Michaliszen