<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Need help on the .net code for updating the M expression code with .net for SSAS Tabular model in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-the-net-code-for-updating-the-M-expression-code/m-p/643893#M18792</link>
    <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help on the code for updating the M expression code with .net for SSAS Tabular model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;we have table with partition and we have to update the partition query using .net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have code to replace the existing M Expression with New one ,unfortunately the changes are not updating in Database LEVEL .(SSAS Tabular) .May be i missed any syntax of the .net code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below code and help out in this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TOA.Partition partition = m.Tables.Find(Table).Partitions[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OverrideCollection oc = new OverrideCollection&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Partitions =&lt;BR /&gt;{&lt;BR /&gt;new PartitionOverride&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;OriginalObject =partition,&lt;/P&gt;&lt;P&gt;Source = new MPartitionSourceOverride&lt;BR /&gt;{&lt;BR /&gt;Expression=expressions&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;var listOc = new List&amp;lt;OverrideCollection&amp;gt;();&lt;BR /&gt;listOc.Add(oc);&lt;BR /&gt;partition.RequestRefresh(TOA.RefreshType.Add, listOc);&lt;/P&gt;&lt;P&gt;// m.Tables[Table].Partitions[1].Refresh(TOA.RefreshType.Full, listOc); //it is not working&amp;nbsp;&lt;BR /&gt;db.Update(UpdateOptions.ExpandFull);&lt;/P&gt;&lt;P&gt;db.Model.SaveChanges();&lt;BR /&gt;m.SaveChanges();&lt;/P&gt;&lt;P&gt;TOA.Partition partition1 = m.Tables.Find(Table).Partitions[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;</description>
    <pubDate>Wed, 13 Mar 2019 09:20:58 GMT</pubDate>
    <dc:creator>santhoshacc</dc:creator>
    <dc:date>2019-03-13T09:20:58Z</dc:date>
    <item>
      <title>Need help on the .net code for updating the M expression code with .net for SSAS Tabular model</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-the-net-code-for-updating-the-M-expression-code/m-p/643893#M18792</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Kindly help on the code for updating the M expression code with .net for SSAS Tabular model.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Scenario:&lt;/P&gt;&lt;P&gt;we have table with partition and we have to update the partition query using .net&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;we have code to replace the existing M Expression with New one ,unfortunately the changes are not updating in Database LEVEL .(SSAS Tabular) .May be i missed any syntax of the .net code.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please see below code and help out in this.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TOA.Partition partition = m.Tables.Find(Table).Partitions[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;OverrideCollection oc = new OverrideCollection&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;Partitions =&lt;BR /&gt;{&lt;BR /&gt;new PartitionOverride&lt;BR /&gt;{&lt;/P&gt;&lt;P&gt;OriginalObject =partition,&lt;/P&gt;&lt;P&gt;Source = new MPartitionSourceOverride&lt;BR /&gt;{&lt;BR /&gt;Expression=expressions&lt;/P&gt;&lt;P&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;}&lt;BR /&gt;&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;var listOc = new List&amp;lt;OverrideCollection&amp;gt;();&lt;BR /&gt;listOc.Add(oc);&lt;BR /&gt;partition.RequestRefresh(TOA.RefreshType.Add, listOc);&lt;/P&gt;&lt;P&gt;// m.Tables[Table].Partitions[1].Refresh(TOA.RefreshType.Full, listOc); //it is not working&amp;nbsp;&lt;BR /&gt;db.Update(UpdateOptions.ExpandFull);&lt;/P&gt;&lt;P&gt;db.Model.SaveChanges();&lt;BR /&gt;m.SaveChanges();&lt;/P&gt;&lt;P&gt;TOA.Partition partition1 = m.Tables.Find(Table).Partitions[1];&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Santhosh&lt;/P&gt;</description>
      <pubDate>Wed, 13 Mar 2019 09:20:58 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-help-on-the-net-code-for-updating-the-M-expression-code/m-p/643893#M18792</guid>
      <dc:creator>santhoshacc</dc:creator>
      <dc:date>2019-03-13T09:20:58Z</dc:date>
    </item>
  </channel>
</rss>

