Created
January 6, 2012 08:28
-
-
Save msbukkuri/1569690 to your computer and use it in GitHub Desktop.
GetHandler (Full)
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.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