public void UpdateModel(Audio a) { LocalPath = a.LocalPath; AudioFormatInt = a.AudioFormatInt; ChannelConfigurationInt = a.ChannelConfigurationInt; SampleRate = a.SampleRate; Data = a.Data; DurationSeconds = a.DurationSeconds; }
public override Audio Update(Audio obj) { using (var conn = _sqlLite.GetConnection()) { var a = conn.Find<Audio>(obj.AudioID); a.UpdateModel(obj); conn.Update(a); return a; } }
public override Audio Insert(Audio obj) { obj.DateCreated = DateTime.UtcNow; obj.AudioID = Guid.NewGuid().ToString(); using (var conn = _sqlLite.GetConnection()) { conn.Insert(obj); } return obj; }
public RiffDTO SaveRiff(string name, AudioFormat audioFormat, ChannelConfiguration channelConfiguration, int sampleRate, byte[] data, string userId) { var audio = new Audio(); audio.SetAudioFormat(audioFormat); audio.SetChannelConfiguration(channelConfiguration); audio.SampleRate = sampleRate; audio.Data = data; audio = _ar.Insert(audio); var riff = new Riff(); riff.AudioID = audio.AudioID; riff.Name = name; riff.UserID = userId; riff = _rr.Insert(riff); return new RiffDTO(riff, audio); }
public RiffDTO(Riff r, Audio a) : this(r) { Audio = a; }