Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Update #283 - Prove that we work with mappers like Dapper

  • Loading branch information...
commit d0bbbf1492b4eaeb36f5c325fa586d8f14089e50 1 parent 2abbb61
@avanderhoorn avanderhoorn authored
View
8 source/Glimpse.Mvc3.MusicStore.Sample/Controllers/HomeController.cs
@@ -7,6 +7,7 @@
using System.Linq;
using System.Transactions;
using System.Web.Mvc;
+using Dapper;
using MvcMusicStore.Models;
namespace MvcMusicStore.Controllers
@@ -175,12 +176,7 @@ private List<Album> GetTopSellingAlbums(int count)
scope.Complete();
}
- using (var command = connection.CreateCommand())
- {
- command.CommandText = "SELECT COUNT(*) FROM Albums WHERE Title LIKE 'K%'";
- command.CommandType = CommandType.Text;
- result3 = (int)command.ExecuteScalar();
- }
+ var albums = connection.Query<Album>("SELECT * FROM Albums WHERE Title LIKE 'K%'");
}
var test = storeDB.Database.ExecuteSqlCommand("SELECT count(*) FROM Albums WHERE Title LIKE 'The%'");
View
3,362 source/Glimpse.Mvc3.MusicStore.Sample/Framework/SqlMapper.cs
3,362 additions, 0 deletions not shown
View
1  source/Glimpse.Mvc3.MusicStore.Sample/Glimpse.Mvc3.MusicStore.Sample.csproj
@@ -85,6 +85,7 @@
<Compile Include="Controllers\ShoppingCartController.cs" />
<Compile Include="Controllers\StoreController.cs" />
<Compile Include="Controllers\StoreManagerController.cs" />
+ <Compile Include="Framework\SqlMapper.cs" />
<Compile Include="Global.asax.cs">
<DependentUpon>Global.asax</DependentUpon>
</Compile>
Please sign in to comment.
Something went wrong with that request. Please try again.