Skip to content

Commit

Permalink
add configuration for the PersonName , dependency injection
Browse files Browse the repository at this point in the history
  • Loading branch information
nixhantb committed Feb 16, 2024
1 parent 5cfebd1 commit f64fbe5
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
using JobLeet.WebApi.JobLeet.Core.Entities.Common.V1;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;

namespace JobLeet.WebApi.JobLeet.Infrastructure.Data.Contexts.V1
{
public class PersonNameConfiguration : IEntityTypeConfiguration<PersonName>
{
public void Configure(EntityTypeBuilder<PersonName> builder)
{
builder.ToTable("PersonName");
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).HasColumnName("personname_id");
builder.Property(e => e.FirstName).HasColumnName("first_name");
builder.Property(e => e.MiddleName).HasColumnName("middle_name");
builder.Property(e => e.LastName).HasColumnName("last_name");
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ public class SkillConfiguration : IEntityTypeConfiguration<Skill>
public void Configure(EntityTypeBuilder<Skill> builder)
{
builder.ToTable("SkillModel");
builder.HasKey(x => x.Id);
builder.HasKey(e => e.Id);
builder.Property(e => e.Id).HasColumnName("skill_id");
builder.Property(e => e.Title).HasColumnName("skill_title");
builder.Property(e => e.Description).HasColumnName("skill_description");
Expand Down

0 comments on commit f64fbe5

Please sign in to comment.