-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Day 36 - Log & LogMap Classes Adding
- Loading branch information
Showing
6 changed files
with
1,904 additions
and
101 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
using EntityLayer.Concrete; | ||
using Microsoft.EntityFrameworkCore; | ||
using Microsoft.EntityFrameworkCore.Metadata.Builders; | ||
|
||
namespace DataAccessLayer.Concrete.Configurations | ||
{ | ||
public class LogMap:IEntityTypeConfiguration<Log> | ||
{ | ||
public void Configure(EntityTypeBuilder<Log> builder) | ||
{ | ||
builder.HasKey(l => l.Id); | ||
builder.Property(l => l.Id).ValueGeneratedOnAdd(); | ||
|
||
builder.Property(l => l.MachineName).IsRequired(); | ||
builder.Property(l => l.MachineName).HasMaxLength(50); | ||
|
||
builder.Property(l => l.Logged).IsRequired(); | ||
|
||
builder.Property(l => l.Level).IsRequired(); | ||
builder.Property(l => l.Level).HasMaxLength(50); | ||
|
||
builder.Property(l => l.Message).IsRequired(); | ||
builder.Property(l => l.Message).HasColumnType("NVARCHAR(MAX)"); | ||
|
||
builder.Property(l => l.Logger).IsRequired(false); | ||
builder.Property(l => l.Logger).HasMaxLength(250); | ||
|
||
builder.Property(l => l.Callsite).IsRequired(false); | ||
builder.Property(l => l.Callsite).HasColumnType("NVARCHAR(MAX)"); | ||
|
||
builder.Property(l => l.Exception).IsRequired(false); | ||
builder.Property(l => l.Exception).HasColumnType("NVARCHAR(MAX)"); | ||
|
||
builder.ToTable("Logs"); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.