Example #1
0
        public void SyncTheFiles()
        {
            IEnumerable <tblProduct> products = unitOfWork.Products.Get(null, null, "tblFile");

            foreach (var product in products)
            {
                //download file
                byte[] onlineFile = readFile.DownloadFile(product.Url);
                if (onlineFile == null)
                {
                    continue;
                }

                //update datasource
                handleData.UpdateData(product, onlineFile);
            }

            //save data
            handleData.Commit();
        }