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

InlineQuery and ExecuteTypedList() #278

Open
vovikdrg opened this issue Jan 31, 2012 · 0 comments
Open

InlineQuery and ExecuteTypedList() #278

vovikdrg opened this issue Jan 31, 2012 · 0 comments

Comments

@vovikdrg
Copy link

i have query new InlineQuery(Provider, usersSql).ExecuteTypedList();
but in my user model i have SubSonicColumnNameOverrideAttribute and it doesnt work properly overrided columns are not set.

But why not to work with Columns override instead of passing column names like
in Database.Load(

var overridingAttributes = (from p in iType.GetProperties()
let attr = p.GetCustomAttributes(typeof(SubSonicColumnNameOverrideAttribute), true)
select new { Property = p, Attribute = attr.First() as SubSonicColumnNameOverrideAttribute });

and replace if (currentProp == null && ColumnNames != null && ColumnNames.Count > i) {
currentProp = cachedProps.First(x => x.Name == ColumnNames[i]);
}

to

if (currentProp == null)
{
dynamic customObject = overridingAttributes.FirstOrDefault(arg => arg.Attribute.ColumnName == pName);
if (customObject != null)
{
currentProp = customObject.Property;
}
}

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

No branches or pull requests

1 participant