public static ReleaseCollectionViewModel BuildByTargetDateDesc(int productId) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); ReleaseCollectionViewModel releaseCollectionViewModel = new ReleaseCollectionViewModel(); Product product = scrumTimeEntities.Products.First<Product>(p => p.ProductId == productId); var results = from s in product.Releases orderby s.Target descending select s; List<Release> releases = results.ToList<Release>(); releaseCollectionViewModel.Releases = releases; releaseCollectionViewModel.ProductId = productId; return releaseCollectionViewModel; }
public static ReleaseCollectionViewModel BuildByTargetDateDesc(int productId) { ScrumTimeEntities scrumTimeEntities = new ScrumTimeEntities(); ReleaseCollectionViewModel releaseCollectionViewModel = new ReleaseCollectionViewModel(); Product product = scrumTimeEntities.Products.First <Product>(p => p.ProductId == productId); var results = from s in product.Releases orderby s.Target descending select s; List <Release> releases = results.ToList <Release>(); releaseCollectionViewModel.Releases = releases; releaseCollectionViewModel.ProductId = productId; return(releaseCollectionViewModel); }