Skip to content
Browse files

Fixed GetChirp repository method and provided implementation for Dele…

…teChirp.
  • Loading branch information...
1 parent bef62e8 commit a5c07ad8e1e5cce804e2f11ce1ae8c322f958658 @yeurch yeurch committed May 9, 2012
Showing with 6 additions and 2 deletions.
  1. +6 −2 Chirpy.Data/Repository/ChirpRepository.cs
View
8 Chirpy.Data/Repository/ChirpRepository.cs
@@ -89,7 +89,11 @@ private void SaveChirp(Data.Model.Chirp chirp)
public void DeleteChirp(int id)
{
- throw new NotImplementedException();
+ using (IDocumentSession session = _documentStore.OpenSession(_databaseName))
+ {
+ session.Advanced.Defer(new Raven.Abstractions.Commands.DeleteCommandData { Key = "chirps/" + id.ToString() });
+ session.SaveChanges();
+ }
}
@@ -125,7 +129,7 @@ public Domain.Model.Chirp GetChirp(int id)
{
using (IDocumentSession session = _documentStore.OpenSession(_databaseName))
{
- Data.Model.Chirp dataChirp = session.Load<Data.Model.Chirp>(id.ToString());
+ Data.Model.Chirp dataChirp = session.Load<Data.Model.Chirp>("chirps/" + id.ToString());
return dataChirp.ToDomainChirp();
}
}

0 comments on commit a5c07ad

Please sign in to comment.
Something went wrong with that request. Please try again.