public static StoryCollectionViewModel BuildByPriorityAsc(int productId) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); StoryCollectionViewModel storyCollectionViewModel = new StoryCollectionViewModel(); Product product = scrumTimeEntities.Products.First<Product>(p => p.ProductId == productId); var results = from s in product.Stories orderby s.Priority ascending select s; List<Story> stories = results.ToList<Story>(); storyCollectionViewModel.Stories = stories; return storyCollectionViewModel; }
public static StoryCollectionViewModel BuildByPriorityAsc(int productId) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); StoryCollectionViewModel storyCollectionViewModel = new StoryCollectionViewModel(); Product product = scrumTimeEntities.Products.First <Product>(p => p.ProductId == productId); var results = from s in product.Stories orderby s.Priority ascending select s; List <Story> stories = results.ToList <Story>(); storyCollectionViewModel.Stories = stories; return(storyCollectionViewModel); }