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

Introduce DefaultDbContextAttribute to set a default dbcontext #1119

Closed
hikalkan opened this issue Jun 17, 2016 · 2 comments
Closed

Introduce DefaultDbContextAttribute to set a default dbcontext #1119

hikalkan opened this issue Jun 17, 2016 · 2 comments
Assignees
Milestone

Comments

@hikalkan
Copy link
Member

This can be useful in a multi dbcontext project to get default dbcontext if there are multiple dbcontext for given conditions.

@acjh
Copy link
Contributor

acjh commented Apr 3, 2018

filteredTypes = filteredTypes
.Where(type => !type.GetTypeInfo().IsDefined(typeof(DefaultDbContextAttribute), true))
.ToList();
if (filteredTypes.Count == 1)
{
return filteredTypes[0];
}
throw new AbpException(string.Format(
"Found more than one concrete type for given DbContext Type ({0}) define MultiTenancySideAttribute with {1}. Found types: {2}.",

Should that ! be removed?

Related: https://forum.aspnetboilerplate.com/viewtopic.php?p=28420

@hikalkan
Copy link
Member Author

hikalkan commented Apr 3, 2018

I think so. You can send a PR if you like :)

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

No branches or pull requests

2 participants