public ConfigurationViewModel Build(Platformus.Models.Configuration configuration) { return new ConfigurationViewModel() { Id = configuration.Id, Name = configuration.Name, Variables = this.handler.Storage.GetRepository<IVariableRepository>().FilteredByConfigurationId(configuration.Id).Select( v => new VariableViewModelBuilder(this.handler).Build(v) ) }; }
private BackendMenuGroupViewModel GetBackendMenuGroup(List<BackendMenuGroupViewModel> backendMenuGroupViewModels, Platformus.Infrastructure.BackendMenuGroup backendMenuGroup) { BackendMenuGroupViewModel backendMenuGroupViewModel = backendMenuGroupViewModels.FirstOrDefault(bmg => bmg.Name == backendMenuGroup.Name); if (backendMenuGroupViewModel == null) { backendMenuGroupViewModel = new BackendMenuGroupViewModelBuilder(this.handler).Build(backendMenuGroup); backendMenuGroupViewModels.Add(backendMenuGroupViewModel); } return backendMenuGroupViewModel; }