Created
July 17, 2014 15:10
-
-
Save mgroves/8f3495a91b52e0b18b28 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 Dapper; | |
using Ledger.Models.Entities; | |
namespace Ledger.Models.CommandQuery.Ledgers | |
{ | |
public class CreateLedgerCommand : ICommand | |
{ | |
readonly LedgerEntity ledger; | |
public CreateLedgerCommand(LedgerEntity ledger) | |
{ | |
this.ledger = ledger; | |
} | |
public void Execute(IDbConnection db) | |
{ | |
db.Execute("INSERT INTO ledgers (ledgerdesc, isactive) VALUES (@LedgerDesc, @IsActive)", | |
new { ledger.LedgerDesc, ledger.IsActive }); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment