I mean, using the gin Context in controller, how to bind the model with association.
c.ShouldBindJSON(&product);
Hi Umesh,
Thanks for the nice blog post. May I check with you how would you bind the model that has association to another models.
I'm trying to follow your post, but facing challenge at this point. Appreciate your feedback on this.
type Product struct {
gorm.Model
Name string `gorm:"type:varchar(50)"`
Description string
CountryID uint
Country Country
ProductGroupID uint
ProductGroup ProductGroup
Website string
}
type ProductGroup struct {
gorm.Model
Name string `gorm:"type:varchar(50)"`
Description string
}
Mehrdad Dolatkhah
WOW, Great. I'll wait for your next part. thank you