abp icon indicating copy to clipboard operation
abp copied to clipboard

SequentialGuidGenerator by default

Open Ice2burn opened this issue 5 years ago • 4 comments

As states in ABP documentation:

IGuidGenerator service creates sequential GUIDs (implemented by the SequentialGuidGenerator by default)

However in many places of the framework SimpleGuidGenerator is used as default, for example in DomainService.cs: protected IGuidGenerator GuidGenerator => LazyServiceProvider.LazyGetService<IGuidGenerator>(SimpleGuidGenerator.Instance);

image

I can't find any mentions to inject it manually services.AddTransient<IGuidGenerator, SequentialGuidGenerator>();

So, is this by design or is this a documentation inaccuracy?

Ice2burn avatar Mar 18 '21 15:03 Ice2burn

hi

  • Your ABP Framework version.
  • Steps needed to reproduce the problem.

The SequentialGuidGenerator inherit ITransientDependency by default.

maliming avatar Mar 19 '21 01:03 maliming

Abp 4.2.2. Tested in console startup template. Inherit HelloWorldService from DomainService. Example: MyCompanyName.MyProjectName.zip

Ice2burn avatar Mar 19 '21 09:03 Ice2burn

[DependsOn(
    typeof(AbpAutofacModule),
    typeof(AbpGuidsModule)
)]
public class MyProjectNameModule : AbpModule

maliming avatar Mar 19 '21 09:03 maliming

SimpleGuidGenerator is enough for a console app.

gdlcf88 avatar Mar 19 '21 09:03 gdlcf88