Code to get the latest version of an entitiy using wcf?

Hi,
I am using WCF services to get entities in MDS. I want to get the entities only in the l;atest version. Can you please share code/api asto how to get the latest version of a model in MDS using WCF?
Thanks

You can use MetadataGet API to get all versions associated with the model and then sort them by CreatedDateTime or
UpdatedDateTime depending how you define "the latest version" .
The code would be like :
var mdGetRequest = new MetadataGetRequest
SearchCriteria =
Models = new Collection<DC.Identifier>()
new DC.Identifier() {Name = "Account"}
ResultOptions = {Versions = DC.ResultType.Identifiers},
// Call MDS service
MetadataGetResponse mdGetResponse = MyServicesApiUtility.MdsService.MetadataGet(mdGetRequest);
if (mdGetResponse.OperationResult.Errors.Count == 0 && mdGetResponse.Metadata.Versions.Count != 0)
var versions = new List<DC.Version>(mdGetResponse.Metadata.Versions);
versions.Sort(
(ver1, ver2) => ver2.AuditInfo.CreatedDateTime.CompareTo(ver1.AuditInfo.CreatedDateTime));
return versions.First();
else
throw new Exception(string.Format("No version related to model {0}.", "Account"));

Similar Messages

  • I have a mac  book pro that i bought in late 2009. My current software is snow leopard version 10.5.8. I would like to get the new lion operating system but I cant without first getting the latest version of snow leopard. it doesnt show on software updat

    I have a mac book pro that i bought in late 2009. My current software is snow leopard version 10.5.8. I would like to get the new lion operating system but I cant without first getting the latest version of snow leopard. however when I go to update my software it doesnt show that any update is available.

    10.5.8 is Leopard, not Snow Leopard. You need the Snow Leopard DVD;
    You can get it only by phone now from Apple.
    In the US, call 1-800-MY-APPLE and ask for a sales assistant. Last quoted price was $19.99 for the single-user and $29.99 for the family licence.
    For other countries, check here; http://support.apple.com/kb/HE57
    Don't forget to ask for Sales; the tech support guys can't help.
    If you want Lion, rather than Mountain Lion, the same Sales team can give you a download code to use at the Mac AppStore.
    To get the App Store, you need to update your new Snow Leopard from 10.6.3 (which is the version on the installer) to 10.6.8 with the combo update; http://support.apple.com/kb/DL1399
    Be warned that the upgrades will render a lot of older software unusable, and will need new drivers for printers and scanners in all likelihood.

  • How to get the latest version from DTR

    Hi all,
              I have all the latest code in my system 1 and i checkined the activites.Now i want all that code in my system 2.
    Now i used sync from sources to get the lateset code.
    But i am not able to get all the files and the build is getting failed.
    Can any one plz help me out
    Regards
    Padma N

    Hi,
             Inorder to get the lateset version from DTR i used the procedure given by you.But at the second time if i want to get the lateset version from DTR wat to do??I didnt find the option of create project again because i already have to project in my workspace.
    wat to do inorder to get the lateset source code from DTR 2nd time???
    Regards
    Padma N

  • I can't get the latest version of iTunes 12.0.1 for Windows (64-bit) to work on my laptop.

    I can't get the latest version of iTunes 12.0.1 for Windows (64-bit) to work on my laptop. It says it has successfully downloaded and installed, but when I try to connect my new iPhone 6 to iTunes i get an error message 'need to install new software' but i thought i had! Please help me as i have had to connect my phone to someone else's mac and therefor don't have my music etc on my phone HELP!  I have had IT support at work trying to figure it out and no one can!

    For general advice see Troubleshooting issues with iTunes for Windows updates.
    The steps in the second box are a guide to removing everything related to iTunes and then rebuilding it which is often a good starting point unless the symptoms indicate a more specific approach. Review the other boxes and the list of support documents further down page in case one of them applies.
    Your library should be unaffected by these steps but there is backup and recovery advice elsewhere in the user tip.
    tt2

  • Why when I uncheck the McAfee box I am forced to download McAfee to get the latest version of Flash Player? What is the work around here?

    Why when I uncheck the McAfee box I am forced to download McAfee to get the latest version of Flash Player? What is the work around here?

    I received your PM.  Yes, the links have changed:
    Flash Player for ActiveX (Internet Explorer)
    Flash Player Plug-in (All other browsers)
    Flash Player for Mac OS X

  • I need to get the latest version of Adobe Reader.  Is this still free?  How can I receive automatic upgrades?

    I need to get the latest version of Adobe Reader.  Is this still free?  How can I receive automatic upgrades?

    Of course the free Reader is still available: http://get.adobe.com/reader/
    To get automatic updates set the Updater in the Reader Preferences.

  • How to get the latest versions of Internet Explorer t

    We are running Single Primary Site with SCCM 2012 R2. 
    I
    cant seem to find out how to get the latest versions of Internet Explorer to be included in software updates?  Do you have to download this separately and install manually?

    Like Henrik said, make sure you have the Classifications selected that you want to address. IE 11 is the current browser, that was added to the catalog a few months back. If you are searching for this month you wont find it.

  • Adobe reader xi cannot be 'enabled' once it is installed. FF told me to get the latest version as old version was unsafe.what do i do?

    adobe reader xi cannot be 'enabled' in FF once it is installed. FF told me to get the latest version as old version was unsafe.
    what do i do?
    (win7) (FF18.01).

    There are other things that need your attention.
    Please Update to the latest Firefox 20.0.x version.
    *Help > About Firefox
    *https://support.mozilla.org/kb/update-firefox-latest-version
    *https://support.mozilla.com/kb/Updating+Firefox
    The Firefox Firefox/18.0 version that you currently run is no longer supported with security updates
    *http://kb.mozillazine.org/Adobe_Reader
    *http://get.adobe.com/reader/otherversions/

  • Why Can't I get the latest version of Adobe Muse?!

    After reading countless forums, I came to the conclusion that if I have a 32-bit operating system, I am unable to get the latest version of Muse? Can somebody please confirm this for me or at least give me instruction on how to get the latest version. Currently I have version 7.4 Build 30, CL 784238 AIR Runtime: 17.0.0.144
    I have tried countless workarounds:
    1. Uninstalled & re-installed Adobe Creative Cloud
    2. Deleted the OOBE.db files
    3. Run Adobe Creative Cloud Utility Tool
    4.Manually installing Adobe Muse (separate from the Creative Cloud)

    System requirements | Muse

  • I have downloaded 15 versions of Firefox this week - 8 were on Wednesday. Why can't I get the latest version the first time I download instead of having to download each change even though you make 8 changes in one day. This is getting tiresome.!!!!!

    When I first pull up Firefox it often says I'm not using the latest version. I go to the download page and start the download. Then when its completed and the start page comes up it usually says I don't have the latest version. I went through 8 downloads on Wednesday January 4 before I got the latest. Why didn't I get the latest version the first time I downloaded.?

    Firefox 9.0.1 is the latest release version.
    Which page do you have set as your Homepage or Start Page?
    This - http://www.google.com/firefox - is the old Firefox Start Page used by the Firefox 3.6 and earlier versions of Firefox. Not being maintained by Google and it shows all versions of Firefox as needing to be updated, even pre-release tester versions that are months away from being released to the public at large.
    Starting with the Firefox 4 version, Firefox is using a "local" Start Page with the address of '''about:home'''. It looks similar to the old Start Page, but it isn't exactly the same.

  • I can't get the latest version of iTunes installed on Mac.

    I can't get the latest version of itunes to update correctly. It seems to hang up on installing 2 items, running package scripts.
    I've tried downloading through the browser with no luck too. Suggestions?

    Have you tried removing your existing version of iTunes prior to doing the install, willie? See the following document for instructions:
    Removing iTunes for Mac OS X

  • Cannot install v11.7.700.202 - error stating "get the latest version." WIN 7 Pro 64-bit

    The latest version caused issues with ADP administrators, and we have to go back to previous version.  But I keep getting error with the only options to  "click here" to get the lateste version or Quit the install. Urgh!

    Older versions (standalone installers) are here:  http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html

  • I have Photoshop Elements 6.0 for mac. What do I need to do to get the latest version?

    I havePhotoshop Elements 6.0 for mac. What do I need to do to get the latest version?

    See http://www.adobe.com/products/photoshop-elements/buying-guide.displayTab3.html

  • I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009, I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009

    I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009, I am running on OS X 10.5.8, how to I get the latest version of iCal??? I have my computer since 2009

    You need to install a newer Mac OS X version to get a newer version of iCal. If you're using a PowerPC Mac, you can't upgrade the OS or iCal further.
    (60198)

  • How do i get the latest version of safari on my macbook pro? where is this in the apple store??

    How do I get the latest version of safari on my macbook pro?

    Upgrading to Yosemite
    You can upgrade to Yosemite from Lion or directly from Snow Leopard. Yosemite can be downloaded from the Mac App Store for FREE.
    Upgrading to Yosemite
    To upgrade to Yosemite you must have Snow Leopard 10.6.8 or Lion installed. Download Yosemite from the App Store. Sign in using your Apple ID. Yosemite is free. The file is quite large, over 5 GBs, so allow some time to download. It would be preferable to use Ethernet because it is nearly four times faster than wireless.
        OS X Mavericks- System Requirements
          Macs that can be upgraded to OS X Yosemite
             1. iMac (Mid 2007 or newer) - Model Identifier 7,1 or later
             2. MacBook (Late 2008 Aluminum, or Early 2009 or newer) - Model Identifier 5,1 or later
             3. MacBook Pro (Mid/Late 2007 or newer) - Model Identifier 3,1 or later
             4. MacBook Air (Late 2008 or newer) - Model Identifier 2,1 or later
             5. Mac mini (Early 2009 or newer) - Model Identifier 3,1 or later
             6. Mac Pro (Early 2008 or newer) - Model Identifier 3,1 or later
             7. Xserve (Early 2009) - Model Identifier 3,1 or later
    To find the model identifier open System Profiler in the Utilities folder. It's displayed in the panel on the right.
         Are my applications compatible?
             See App Compatibility Table - RoaringApps.

Maybe you are looking for

  • Admin passwd issue after using apple s option

    I have an old PPC G5 duel 2.0 I still have some information and programming files on this unit which from time to time I still need to access, it has been about a year since I last logged into this unit and found that the last password I remembered i

  • What is the difference between the two?

    Hi Friends, Though I know it would be a strange one for many of you,I would like to clarify myself with this. 1) select * from scott.emp order by 8Execution plan for 1) Execution Plan    0      SELECT STATEMENT Optimizer=ALL_ROWS (Cost=3 Card=14 Byte

  • After updating to iOS 8 on my 5s my battery life has been cut in half.

    After updating to iOS 8 on my 5s my battery life has been cut in half.  I turned off Bluetooth, location services.  It drains it even when not in use.  I am an RN who works 12 hour shifts and I had to charge my phone twice with little use.

  • Why does my hard drive switch on every so often

    Why does my macs Harddrive keep switching on every so often

  • 9800gt bios

    could someone please post the original bios for N9800GT-T2D512-OC (v117)??? or a link to where i could find it... the problem is that i lost my backup of the original when my usb pen drive died, so now I'm in a pickle, cause i messed up the bios and