Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit a4355bb

Browse files
feat: adição do arquivo PropostaConfigurations.cs
1 parent 216fa28 commit a4355bb

File tree

1 file changed

+26
-0
lines changed

1 file changed

+26
-0
lines changed
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
using ContainRs.Api.Domain;
2+
using Microsoft.EntityFrameworkCore;
3+
using Microsoft.EntityFrameworkCore.Metadata.Builders;
4+
5+
namespace ContainRs.Api.Data.Configurations;
6+
7+
public class PropostaConfigurations : IEntityTypeConfiguration<Proposta>
8+
{
9+
public void Configure(EntityTypeBuilder<Proposta> builder)
10+
{
11+
builder.Property(p => p.ValorTotal)
12+
.HasColumnType("decimal(18,2)");
13+
14+
builder.OwnsOne(p => p.Situacao, status =>
15+
{
16+
status.Property(s => s.Status)
17+
.HasColumnName("Status")
18+
.HasConversion<string>();
19+
});
20+
21+
builder.HasOne(p => p.Solicitacao)
22+
.WithMany(s => s.Propostas)
23+
.HasForeignKey(p => p.SolicitacaoId)
24+
.OnDelete(DeleteBehavior.Cascade);
25+
}
26+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /