Exemplo n.º 1
0
        public async Task <int> UpdateAsync(Image image, CancellationTokenSource token)
        {
            B2CImage updateImage = image.AdapterImage();

            var result = await Repository.Update2Async(updateImage, token);

            return(result);
        }
Exemplo n.º 2
0
        public async Task <int> CreateAsync(Image register, int idProduct, int idOffer, CancellationTokenSource token)
        {
            B2CImage newImages = register.AdapterImage();

            newImages.IdProduct = idProduct;
            newImages.IdOffer   = idOffer;

            var result = await Repository.CreateAsync(new List <B2CImage>() { newImages }, token);

            return(result);
        }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="source"></param>
 /// <returns></returns>
 public static Image AdapterImage(this B2CImage source)
 {
     return(new Image()
     {
         IsThumbnail = source.IsThumbnail,
         Id = source.IdImage,
         IdProduct = source.IdProduct,
         IdOffer = source.IdOffer,
         Name = source.Name,
         Url = source.Url
     });
 }
Exemplo n.º 4
0
        public async Task <int> Update2Async(B2CImage entity, CancellationTokenSource token)
        {
            try
            {
                using (var connection = new SqlConnection(ConnectionString).EnsureOpen())
                {
                    int affectedRows = 0;

                    affectedRows += await connection.UpdateAsync("B2CImage", entity, new QueryField("IdImage", entity.IdImage));

                    return(affectedRows);
                }
            }
            catch (Exception exc)
            {
                token.Cancel(true);
                string mensaje = String.Format(MessagesInfraestructure.ErrorGetByKeyAsync, "en Repositorio base");
                throw new InfraestructureExcepcion(mensaje, exc);
            }
        }
Exemplo n.º 5
0
 public Task <Boolean> UpdateAsync(B2CImage entity, CancellationTokenSource cancellationToken)
 {
     throw new NotImplementedException();
 }
Exemplo n.º 6
0
 public void Delete(B2CImage entity)
 {
     throw new NotImplementedException();
 }