Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Danny Blatant 91 posts 358 karma points
    Oct 16, 2014 @ 12:35
    Danny Blatant
    1

    Documentation on Database and Sql Objeect (Umbraco.Core.Persistence)

    Hi all,

    Does anyone know of a good documentation resourse for the Umbraco.Core.Persistence.Database and Umbraco.Core.Persistence.Sql objects? Preferably example driven!

    I have a web app that consumes some data from a 3rd party database. this database is on the same server as umbraco and I've got access by adding a query string to the web.config and I can get a new Database object like so:

    Database database = new Database("3rdPartyDbDSN")
    

    So really I just need some tutorial on how to build complex queries using Umbraco.Core.Persistence.Sql, I only have simple examples like this:

    var query = new Sql().Select("*").From("3rdPartyData");
    

    Also, any gotcha's or things to watch out for when using the Fetch syntax?

    extDatas = database.Fetch<ExternalData>(query);
    

    I can trace the definitions to get an idea but it's labourious so any docs, guides or a tutorial would be most welcome!!!

    PS. I've searched and googled but because these seem to be Umbraco Classes and dot.Net ones (accoring to their inheritence) the terms "Umbraco Sql Object" and "Umbraco Database Object" (et al.) return alot of spurious stuff :(

    Thanks in advance,

    Danny "Blatant"

  • Danny Blatant 91 posts 358 karma points
    Oct 16, 2014 @ 12:48
    Danny Blatant
    1

    I found the source hidden under the Database class here :

    https://github.com/umbraco/Umbraco-CMS/blob/eae00873073f20c60e355ec6e95ff6259ad2652b/src/Umbraco.Core/Persistence/PetaPoco.cs

    Less than ideal! Hoepfully searching for more on using PetaPeco will yield results....

Please Sign in or register to post replies

Write your reply to:

Draft