예제 #1
0
        public async Task SaveArticle(ArticleViewModel article)
        {
            using (var c = _dBConnector.GetIDBConnector())
            {
                //string sql = @"UPDATE Article set name=@name, imagepath=@imagepath, isbn=@isbn, description=@description, url=@url, email=@email, date=@date, price=@price where id=@id";

                //var item = await c.ExecuteAsync(sql, new
                //{
                //    isbn = article.ISBN,
                //    name = article.Name,
                //    description = article.Description,
                //    url = article.Url,
                //    imagepath = article.ImagePath,
                //    email = article.Email,
                //    price = article.Price,
                //    date = article.Date,
                //    id = article.Id,

                //});

                c.Update(new ArticleViewModel {
                    Id          = article.Id,
                    ISBN        = article.ISBN,
                    Name        = article.Name,
                    Description = article.Description,
                    Url         = article.Url,
                    ImagePath   = article.ImagePath,
                    Email       = article.Email,
                    Date        = article.Date,
                    Price       = article.Price
                });
            }
        }