Copied to clipboard

Flag this post as spam?

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


  • Saied 349 posts 674 karma points
    Sep 09, 2015 @ 20:07
    Saied
    0

    Should PetaPoco database calls be done in using statement?

    Is it perfectly fine to do the following:

    private readonly Database _db = new Databse("products");
    
    var products = _db.Fetch<Product>("SELECT * FROM Products");
    

    or

    using(var _db = new Database("products"))
    {
        var products = _db.Fetch<Product>("SELECT * FROM Products");
    }
    
  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies