0
I’m starting to work on a DDD project. I happen to be having a lot of doubts, and as much as I research, it gets more and more confused.
I created this classe
:
public class Teste {
public int Id { get; set; }
public string Nome { get; set; }
public string Sobrenome { get; set; }
}
And this interface
public interface ITesteRepository
{
void Add(Teste queryResult);
void Update(Teste queryResult);
void Delete(Teste queryResult);
IQueryable<Teste> GetByTesteId(int testeId);
}
I know I need to create the mapping now, but I’m not sure how to start, I’ve already researched the Internet, if anyone has any explanation to help me, making it easier for me to understand, or some example I can follow.
Edit
It would be something like:
public class ClienteConfiguration : EntityTypeConfiguration<Cliente>
{
public ClienteConfiguration()
{
HasKey(c => c.ClienteId);
Property(c => c.Nome)
.IsRequired()
.HasMaxLength(150);
Property(c => c.Sobrenome)
.IsRequired()
.HasMaxLength(150);
Property(c => c.Email)
.IsRequired();
}
}
But I wanted to know how to do it, what the logic is.
@Costamilam watched the two videos, and I could not get my doubt, I edited the question.
– Mariana
@Costamilam ah yes, it is because I am still doing tests, and trying to understand rs, but still it was very valuable the videos. Thank you.
– Mariana
@Renan I created the
classe
and theinterface
ofrepository
, but this part of mapping I have doubts. For example. in core, I create the model, then add in context, and then give aadd-migration Model
and then aupdate-database
it creates the mapping. How the project isDDD
do not know how to proceed. I am starting now, so I am still with enough doubts.– Mariana
Using EF or EF Core?
– Costamilam
Now
EF
, but only used inCore
, as I reported above. I think that’s why you’re confusing me.– Mariana