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");
    }
    
Please Sign in or register to post replies

Write your reply to:

Draft