예제 #1
0
 public void UpdateModel(Riff r)
 {
     AudioID = r.AudioID;
     Name = r.Name;
     UserID = r.UserID;
     DurationSeconds = r.DurationSeconds;
 }
예제 #2
0
 public void UpdateModel(Riff a)
 {
     Name = a.Name;
     DateCreated = a.DateCreated;
     AudioID = a.AudioID;
     UserID = a.UserID;
     RiffID = a.RiffID;
     DurationSeconds = a.DurationSeconds;
 }
예제 #3
0
 public RiffDTO(Riff r)
 {
     RiffID = r.RiffID;
     AudioID = r.AudioID;
     UserID = r.UserID;
     Name = r.Name;
     DateCreated = r.DateCreated;
     DurationSeconds = r.DurationSeconds;
 }
        public override Riff Update(Riff obj)
        {
            using (var conn = _sqlLite.GetConnection())
            {
                var a = conn.Find<Riff>(obj.RiffID);
                a.UpdateModel(obj);
                conn.Update(a);

                return a;
            }
        }
        public override Riff Insert(Riff obj)
        {
            obj.DateCreated = DateTime.UtcNow;
            obj.RiffID = Guid.NewGuid().ToString();

            using (var conn = _sqlLite.GetConnection())
            {
                conn.Insert(obj);
            }

            return obj;
        }
예제 #6
0
        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);
        }
예제 #7
0
 public DroidRiff(Riff a)
 {
     UpdateModel(a);
 }
예제 #8
0
 public RiffDTO(Riff r, Audio a)
     : this(r)
 {
     Audio = a;
 }