public IndexViewModel Build(int userId, string orderBy, string direction, int skip, int take) { ICredentialRepository credentialRepository = this.handler.Storage.GetRepository <ICredentialRepository>(); return(new IndexViewModel() { UserId = userId, Grid = new GridViewModelBuilder(this.handler).Build( orderBy, direction, skip, take, credentialRepository.CountByUserId(userId), new[] { new GridColumnViewModelBuilder(this.handler).Build("Credential Type"), new GridColumnViewModelBuilder(this.handler).Build("Identifier", "Identifier"), new GridColumnViewModelBuilder(this.handler).BuildEmpty() }, credentialRepository.Range(userId, orderBy, direction, skip, take).Select(c => new CredentialViewModelBuilder(this.handler).Build(c)), "_Credential" ) }); }