Created
July 21, 2014 17:53
-
-
Save mgroves/f49ce10d1f115c7308a9 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| using System.Data; | |
| using System.Linq; | |
| using Dapper; | |
| using Ledger.Models.Entities; | |
| namespace Ledger.Models.CommandQuery.Ledgers | |
| { | |
| public class GetLedgerByIdQuery : IQuery<LedgerEntity> | |
| { | |
| long id; | |
| public GetLedgerByIdQuery(long id) | |
| { | |
| this.id = id; | |
| } | |
| public LedgerEntity Execute(IDbConnection db) | |
| { | |
| return db.Query<LedgerEntity>("SELECT ledger, ledgerdesc, isactive FROM ledgers WHERE ledger = @id", new { id }).FirstOrDefault(); | |
| } | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment