Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add AddDefaultRepository method #7673

Merged
merged 2 commits into from Feb 26, 2021
Merged

Conversation

realLiangshiwei
Copy link
Member

Resolve #7658

{
if (!typeof(IEntity).IsAssignableFrom(entityType))
{
throw new AbpException($"Given entityType is not an entity: {entityType.AssemblyQualifiedName}. It must implement {typeof(IEntity<>).AssemblyQualifiedName}.");
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
throw new AbpException($"Given entityType is not an entity: {entityType.AssemblyQualifiedName}. It must implement {typeof(IEntity<>).AssemblyQualifiedName}.");
throw new AbpException($"Given entityType is not an entity: {entityType.AssemblyQualifiedName}. It must implement {typeof(IEntity).AssemblyQualifiedName}.");


public IAbpCommonDbContextRegistrationOptionsBuilder AddDefaultRepository(Type entityType)
{
if (!typeof(IEntity).IsAssignableFrom(entityType))
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (!typeof(IEntity).IsAssignableFrom(entityType))
if (!EntityHelper.IsEntity(entityType))

@hikalkan hikalkan merged commit bc0da76 into dev Feb 26, 2021
@hikalkan hikalkan deleted the liangshiwei/addDefaultRepository branch February 26, 2021 12:04
@hikalkan
Copy link
Member

I will handle these. Thanks ;)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create options.AddDefaultRepository<TEntity>() to register a single default repository
2 participants