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

Nested object #236

Open
GrazDeKa opened this issue Sep 30, 2021 · 0 comments
Open

Nested object #236

GrazDeKa opened this issue Sep 30, 2021 · 0 comments

Comments

@GrazDeKa
Copy link

Hi
if I have a class

public Class1
{
string prop1{get; set;}
string prop2{get; set;}
Class2 prop3{get; set;}
}

public Class2
{
string prop1{get; set;}
string prop2{get; set;}
}

Then I set the mapper as:

mapper = new ModelToTableMapper();
mapper.AddMapping(model => model.prop1, column[0]);
mapper.AddMapping(model => model.prop2, column[1]);
mapper.AddMapping(model => model.prop3.prop1, column[2]);
mapper.AddMapping(model => model.prop3.prop2, column[3]);

and the sqldependency as
dependency = new SqlTableDependency(ConnectionString, TableName, mapper: mapper);

With this code it tracks only the changes in the simple properties of Class1 (prop1, prop2) while it doesn't track changes of the properties of class 2 (prop3.prop1, prop3.prop2).
I think this is related to the nested object. Is there a way to avoid this?

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