This repository has been archived on 2023-10-28. You can view files and clone it, but cannot push or open issues or pull requests.
pwt-0x01-ng/Models/Database/Conf/ProductConf.cs
surtur 3de6d80f37
All checks were successful
continuous-integration/drone/push Build is passing
cleanup: remove unused usings throughout
2021-02-10 00:34:56 +01:00

14 lines
475 B
C#

using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
namespace pwt_0x01_ng.Models.Database.Conf
{
public class ProductConf : IEntityTypeConfiguration<Product>
{
public void Configure(EntityTypeBuilder<Product> builder)
{
builder.Property(nameof(Product.Created)).ValueGeneratedOnAdd().HasDefaultValueSql("NOW()");
builder.Property(nameof(Product.Updated)).ValueGeneratedOnAddOrUpdate().HasDefaultValueSql("NOW()");
}
}
}