public Response GetProjectById(int id) { response = responseFactory.CreateProjectResponse(); response.project = magmaDbContext.Projects.Find(id); return(responseFactory.UpdateResponse(response, "Success: found project", ResponseStatus.OK)); }
public Response GetProjectById(int id) { response = responseFactory.CreateProjectResponse(); response = projectDao.GetProjectById(id); if (response.project.id != 0) { response.project.tracks = trackDao.GetTracksByProjectId(id).tracks; foreach (Track track in response.project.tracks) { if (track.id != 0) { track.rack = rackDao.GetRackByTrackId(track.id).rack; if (track.rack.id != 0) { track.rack.plugins = pluginDao.GetPluginsByRackId(track.rack.id).plugins; foreach (Plugin plugin in track.rack.plugins) { if (plugin.id != 0) { switch (plugin.pluginType) { case PluginType.SAMPLER: plugin.sampler = samplerDao.GetSamplerByPluginId(plugin.id).sampler; break; case PluginType.SYNTHESIZER: plugin.synthesizer = synthesizerDao.GetSynthesizerByPluginId(plugin.id).synthesizer; break; case PluginType.AUDIOEFFECT: plugin.audioEffect = audioEffectDao.GetAudioEffectByPluginId(plugin.id).audioEffect; break; } } } } } } } return(responseFactory.UpdateResponse(response, "Success: found project", ResponseStatus.OK)); }