Skip to content

Instantly share code, notes, and snippets.

@msbukkuri
Created January 6, 2012 08:28
Show Gist options
  • Save msbukkuri/1569690 to your computer and use it in GitHub Desktop.
Save msbukkuri/1569690 to your computer and use it in GitHub Desktop.
GetHandler (Full)
using System.Collections.Generic;
using SimpleProjectManagement.Models;
using SimpleProjectManagement.Repositories;
namespace SimpleProjectManagement.Features
{
public class GetHandler
{
private readonly IStoryListRepository _storyListRepository;
public GetHandler(IStoryListRepository storyListRepository)
{
_storyListRepository = storyListRepository;
}
public DashboardViewModel Execute(DashboardRequestModel requestModel)
{
return new DashboardViewModel()
{
Stories = _storyListRepository.GetAll(),
StoryModel = new Story()
};
}
}
public class DashboardViewModel
{
public IEnumerable<Story> Stories { get; set; }
public Story StoryModel { get; set; }
public DashboardViewModel()
{
Stories = new List<Story>();
StoryModel = new Story();
}
}
public class DashboardRequestModel { }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment