public void Configure(EntityTypeBuilder <PlantDetails> builder)
        {
            builder.ToTable("PlantDetails");

            builder.HasKey(ci => ci.PlantDetailsId);

            builder.Property(ci => ci.PlantDetailsId)
            .UseHiLo("plant_details_hilo")
            .IsRequired();

            builder.Property(ci => ci.Name)
            .IsRequired(true)
            .HasMaxLength(100);

            builder.Property(ci => ci.Description)
            .IsRequired(false)
            .HasMaxLength(500);

            builder.Property(ci => ci.CategoryId)
            .IsRequired(true);

            builder.Property(ci => ci.Price)
            .IsRequired(true)
            .HasPrecision(18, 2);

            builder.Property(ci => ci.Weight)
            .IsRequired(true)
            .HasPrecision(18, 2);

            builder.Property(ci => ci.UnitId)
            .IsRequired(true);

            builder.Property(ci => ci.Stock)
            .IsRequired(true);

            builder.Property(ci => ci.ImageName)
            .IsRequired(false);

            builder.Property(ci => ci.UserId)
            .IsRequired(true)
            .HasMaxLength(100);

            // To seed data
            builder.HasData(PlantListingContextSeed.GetPreconfiguredPlantDetails());
        }
        private void SeedDBContext(DbContextOptions <PlantListingContext> dbOptions)
        {
            using (var dbContext = new PlantListingContext(dbOptions))
            {
                if (!dbContext.PlantCategories.Any())
                {
                    dbContext.PlantCategories.AddRange(PlantListingContextSeed.GetPreconfiguredPlantCategories());
                }

                if (!dbContext.WeightUnits.Any())
                {
                    dbContext.WeightUnits.AddRange(PlantListingContextSeed.GetPreconfiguredWeightUnits());
                }

                if (!dbContext.PlantDetails.Any())
                {
                    dbContext.PlantDetails.AddRange(PlantListingContextSeed.GetPreconfiguredPlantDetails());
                }

                dbContext.SaveChanges();
            }
        }