示例#1
0
 public mod.Art AddArt(mod.Art newArt)
 {
     if (Exists(newArt.Id))
     {
         newArt = _mapper.Parse(_context.Arts.Find(newArt.Id));
     }
     else
     {
         _context.Arts.Add(_mapper.Parse(newArt));
         _context.SaveChanges();
     }
     return(newArt);
 }
示例#2
0
        public void Save(mod.Art art)
        {
            Art tc = _context.Arts.Find(art.Id);

            tc.Name             = art.Name;
            tc.Description      = art.Description;
            tc.Artistcommentary = art.ArtistStatement;
            tc.Buynowprice      = art.BuyNoWPrice;
            tc.Currentvalue     = art.CurrentValue;


            _context.SaveChanges();
        }
示例#3
0
 public entity.Art Parse(mod.Art art)
 {
     entity.Art c = new entity.Art();
     c.Name             = art.Name;
     c.Description      = art.Description;
     c.Artistcommentary = art.ArtistStatement;
     c.Buynowprice      = art.BuyNoWPrice;
     c.Currentvalue     = art.CurrentValue;
     if (c.Id == null)
     {
         c.Id = art.Id;
     }
     return(c);
 }