Skip to content

Allow Custom Name Provider By Method Inject Repository #72

Description

@ren0503

Currently, when InjectRepository we need mapping repo correct name

sqlorm.ForFeature(sqlorm.NewRepo(CompanyDB{})),

the struct in ForFeature define need matching with the struct when InjectRepository:

repo := sqlorm.InjectRepository[CompanyDB](module)

Now, we need pass the interface to Inject instead of the struct, so we can sync by function RepositoryName in struct:

func (CompanyDB) RepositoryName() core.Provide {
  return core.Provide("CompanyRepository")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Projects

Relationships

None yet

Development

No branches or pull requests

Issue actions