Hello,
I have such problem:
We get data from views, and then we change some properties in view record entities.
When I try to save changes, these records are marked as changed (dirty).
So, How can I tell DataAccess to skip any changes (don't track changes) for some domain model types (exactly views) and don't generate sql to update such views?
Is it possible?
I tried to add these types as views to model configuration, and set it as readonly, but it still generates sql to change these records in db.
var view = new MetaView(
name: type.Name,
schemaName: schemaName,
fullName: string.Format("{0}.{1}", schemaName, type.Name),
readOnly: true,
pkConstraintName: string.Empty,
insertProcedure: null,
updateProcedure: null,
deleteProcedure: null,
removeRowsProcedure: null,
description: null
);
type.Table = view;
model.Views.Add(view);
But I still get exception:
Update failed: Telerik.OpenAccess.RT.sql.SQLException: Cannot update the view or function 'dbo.vwg_XYZ' because it contains aggregates, or a DISTINCT or GROUP BY clause, or PIVOT or UNPIVOT operator. Statement(s) could not be prepared.
Thank you.