Exemplo n.º 1
0
        public bool UpdateRequest(RequestedModel model)
        {
            var entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = model.Id
            };

            return(Repo.Update(entity));
        }
Exemplo n.º 2
0
 public bool Delete(RequestBlobs entity)
 {
     ResetCache();
     using (var con = Db.DbConnection())
     {
         return(con.Delete(entity));
     }
 }
Exemplo n.º 3
0
        public async Task <bool> UpdateRequestAsync(RequestedModel model)
        {
            var entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = model.Id
            };

            return(await Repo.UpdateAsync(entity).ConfigureAwait(false));
        }
Exemplo n.º 4
0
 public async Task <bool> UpdateAsync(RequestBlobs entity)
 {
     ResetCache();
     using (var con = Db.DbConnection())
     {
         return(await con.UpdateAsync(entity).ConfigureAwait(false));
     }
 }
 public async Task <bool> DeleteAsync(RequestBlobs entity)
 {
     ResetCache();
     using (var con = Db.DbConnection())
     {
         return(await con.DeleteAsync(entity));
     }
 }
Exemplo n.º 6
0
 public long Insert(RequestBlobs entity)
 {
     ResetCache();
     using (var con = Db.DbConnection())
     {
         var id = con.Insert(entity);
         return(id);
     }
 }
Exemplo n.º 7
0
        public async Task <int> InsertAsync(RequestBlobs entity)
        {
            ResetCache();
            using (var con = Db.DbConnection())
            {
                var id = await con.InsertAsync(entity).ConfigureAwait(false);

                return(id);
            }
        }
Exemplo n.º 8
0
        public long AddRequest(RequestedModel model)
        {
            var entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId
            };
            var id = Repo.Insert(entity);

            model.Id = (int)id;

            entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = (int)id, MusicId = model.MusicBrainzId
            };
            var result = Repo.Update(entity);

            return(result ? id : -1);
        }
Exemplo n.º 9
0
        public async Task <int> AddRequestAsync(RequestedModel model)
        {
            var entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId
            };
            var id = await Repo.InsertAsync(entity).ConfigureAwait(false);

            model.Id = id;

            entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = id, MusicId = model.MusicBrainzId
            };
            var result = await Repo.UpdateAsync(entity).ConfigureAwait(false);

            return(result ? id : -1);
        }
Exemplo n.º 10
0
        public long AddRequest(RequestedModel model)
        {
            var entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId
            };
            var id = Repo.Insert(entity);

            // TODO Keep an eye on this, since we are now doing 2 DB update for 1 single request, inserting and then updating
            model.Id = (int)id;

            entity = new RequestBlobs {
                Type = model.Type, Content = ByteConverterHelper.ReturnBytes(model), ProviderId = model.ProviderId, Id = (int)id, MusicId = model.MusicBrainzId
            };
            var result = Repo.Update(entity);

            return(result ? id : -1);
        }