public ConfigurationViewModel Add(ConfigurationWriteModel model) { var configuration = BuildFromWriteModel(model); var entity = repository.Add(configuration); return(ConfigurationViewModel.From(configuration)); }
public ConfigurationViewModel Update(ConfigurationWriteModel model) { var configuration = repository.GetById(model.Id); configuration.ConfigurationComponents = ExtractValidComponents(model); configuration.Name = model.Name; var updated = repository.Update(configuration); return(ConfigurationViewModel.From(updated)); }
public ConfigurationViewModel GetById(long id) { var configuration = repository.GetById(id); return(ConfigurationViewModel.From(configuration)); }