Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public static class MyExtensions
- {
- // Write custom extension methods here. They will be available to all queries.
- // get list of additional databases used. Pass "this" (of type UserQuery)
- internal static List<string> GetAdditionalDatabaseNames(this UserQuery uq)
- {
- var props = uq.GetType().GetProperties();
- var result = new List<string>();
- foreach (var db in props.Where(
- w => w.PropertyType.Name == "TypedDataContext").Distinct())
- {
- result.Add(db.Name);
- }
- return result;
- }
- }
- void Main()
- {
- this.Connection.Database.Dump();
- this.GetAdditionalDatabaseNames().Dump();
- }
Add Comment
Please, Sign In to add comment