public void Update(DalLotImage entity) { var lotImage = entity.ToLotImage(); var existedLotImage = _dbContext.Entry<LotImage>(_dbContext.Set<LotImage>().Find(lotImage.ImageId)); if (existedLotImage == null) { return; } existedLotImage.State = EntityState.Modified; }
public void Delete(DalLotImage entity) { var img = _dbContext.Set<LotImage>().FirstOrDefault(t => t.ImageId == entity.Id); if (img == null) { return; } //var lotImage = entity.ToLotImage(); _dbContext.Set<LotImage>().Remove(img); }
public void Create(DalLotImage entity) { var lotImage = entity.ToLotImage(); _dbContext.Set<LotImage>().Add(lotImage); }