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

CSLA - Stored procedures insert sql is generated with computed fields. #714

Open
niemyjski opened this issue Apr 20, 2020 · 2 comments
Open

Comments

@niemyjski
Copy link
Member

The SQLStoredProcedures template (https://github.com/codesmithtools/Templates/blob/master/Templates/Frameworks/Csla/CSharp/DataAccessLayer/Internal/SQLStoredProcedures.cst) is including computed properties in the updated sql and in code: https://github.com/codesmithtools/Templates/search?q=GetUpdateStoredProcedureName&unscoped_q=GetUpdateStoredProcedureName

We'd need to update the instances above to filter out computed properties in all spots. We could do this by changing Entity.Properties to Entity.GetProperties(PropertyType.UpdateInsert). We'd accept a pr for this.

@fundez
Copy link

fundez commented Apr 29, 2020

Currently the business objects also output all the fields including read-only fields when calling stored procedures. I'm assuming the business objects won't change so the stored procedures would have to accept the same parameters, but would just ignore the calculated fields when executing updates and inserts.

@niemyjski
Copy link
Member Author

It definitely needs a filtered list, I guess it doesn't hurt to pass all of them to the stored procedure (really stinks), but is a quick work around. Could you try updating the stored procedure update statement using the above calls.

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