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/CarouselConf.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
480 B
C#

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