title: breeze and sql server triggers
body: <p>Breeze don't have a look of what's happened to data at server side when saving these data. Breeze team said you must re-query to have updated data. Actions done synchronously during this saving like sql triggers (expl. After Insert) may be considered because of these operations can transform entities during saving so they take place at client : this will be useful for new keys not generated by Breeze like multi-parts keys. I have difficult to work-around this problem. Help?</p>
  
  <p><strong>UPDATE 1:</strong>
  If this is the principle with Breeze it's probrably a bug.</p>
  
  <p>1) The trigger (at server-side) is part of the entity (table) </p>
  
  <p>2) Frameworks used :</p>
  
  <ul>
  <li>server-side framework : .NET Framework 4.5</li>
  <li>client framework : Breeze 1.3.5</li>
  <li>view framework : knockout 2.2.1</li>
  </ul>
  
  <p>3) result scenario from saveChanges:</p>
  
  <pre><code>function saveTousRecos() {
      return manager.saveChanges()
               .then(success)
               .fail(fail);
          function success(saveResult) {
              /* do your post-save work here */
              axi = saveResult.entities[0].jobtab();  
          // axi is an identity key generated at server and sent back to client by Breeze
          // result : Breeze value = (195), the same as server-side (195)
              ara = saveResult.entities[0].seqtab();  
          // ara is a property value inserted by sql FOR INSERT trigger, 
          // result : Breeze value = (NULL), server-side has (13)
              logger.log("Saving succeded... ");
          }
          function fail(error) {
              logger.log("Saving failed: " + error.message);
          }
      }
  </code></pre>
  
  <p>P.S. : all values inserted by SQL triggers are not visible at all unless you re-call entity from server, not from cache; seems like a work-around not the solution I suppose.</p>
  
  <p><strong>UPDATE 2:</strong>
  I think that Breeze considers my return entities as <strong>OData</strong> like.</p>
  
  <p>1) from my Breeze Api controlleur I use this :</p>
  
  <pre><code>return _contextProvider.Context.clients.Where(uc =&gt; uc.refclie == rqnoclie);
  </code></pre>
  
  <p>2) Breeze said :
  With <strong>OData</strong>, any change of the value of a server side computed field will not be available in Breeze after an update. If you need these values refreshed, you must requery...</p>
  
  <p>3) so from now, the solution for me is REQUERY (not good news) to get my computed or triggered results. Hope the future of BeforeSaveEntity interceptors will solve this problem. Or how can I get pure entities for Breeze (not OData but computed or triggered server-side) ? Is there a way to get Out from this trouble?</p>