问题
Scenario: we have a table with partition and we have to update the partition query using .NET
We use the code below to replace the existing M Expression with a new one, but the changes are not updating at the database level (Analysis Tabular). Are there any syntax errors or problems in this code?
TOA.Partition partition = m.Tables.Find(Table).Partitions[1];
OverrideCollection oc = new OverrideCollection
{
Partitions =
{
new PartitionOverride
{
OriginalObject =partition,
Source = new MPartitionSourceOverride
{
Expression=expressions
}
}
}
};
var listOc = new List<OverrideCollection>();
listOc.Add(oc);
partition.RequestRefresh(TOA.RefreshType.Add, listOc);
// m.Tables[Table].Partitions[1].Refresh(TOA.RefreshType.Full, listOc); //it is not working
db.Update(UpdateOptions.ExpandFull);
db.Model.SaveChanges();
m.SaveChanges();
TOA.Partition partition1 = m.Tables.Find(Table).Partitions[1];
来源:https://stackoverflow.com/questions/55156754/changes-not-saved-to-database-when-updating-the-m-expression-for-an-ssas-tabular