minor fixes
This commit is contained in:
@@ -32,7 +32,7 @@ public class ZeroOptions : IZeroOptions
|
||||
{
|
||||
Type type = typeof(TOptions);
|
||||
|
||||
if (!OptionsCache.TryGetValue(type, out object value))
|
||||
if (!OptionsCache.TryGetValue(type, out object value) && ServiceProvider != null)
|
||||
{
|
||||
IOptions<TOptions> options = ServiceProvider.GetService<IOptions<TOptions>>();
|
||||
value = options.Value;
|
||||
|
||||
@@ -123,7 +123,7 @@ public class ZeroDocumentConventionsBuilder : IZeroDocumentConventionsBuilder
|
||||
protected virtual string TransformTypeCollectionNameToDocumentIdPrefix(string name)
|
||||
{
|
||||
RavenOptions options = Options.For<RavenOptions>();
|
||||
if (!options.CollectionPrefix.IsNullOrWhiteSpace())
|
||||
if (options != null && !options.CollectionPrefix.IsNullOrWhiteSpace())
|
||||
{
|
||||
name = options.CollectionPrefix.EnsureEndsWith(IdentityPartsSeparator) + name.TrimStart(options.CollectionPrefix);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user