void IEntityTypeConfiguration <Trend> .Configure(EntityTypeBuilder <Trend> builder)
        {
            ConfigureUserCreatedEntity(builder);

            builder.Property(t => t.Name)
            .IsRequired()
            .HasMaxLength(TrendConstraints.NameMaxLength);

            builder.Property(t => t.FollowersCount)
            .IsRequired();

            builder.Property(t => t.PostsCount)
            .IsRequired();

            builder.Property(t => t.CreateDate)
            .IsRequired();

            builder.HasData(TrendsSeed.Seed());
        }
Esempio n. 2
0
 ICollection <TrendGetAllDto> ITrendBusinessLogic.GetPopular()
 {
     return(mapper.Map <ICollection <TrendGetAllDto> >(TrendsSeed.Seed()));
 }