public FavoriteEntity Create(FavoriteEntity entity) { var r = this._favoriteRepository.Insert(entity); if (r != null) { //TODO:对用户账户操作 this._userService.AddFover(entity.User_Id, 1, entity.CreatedUser); } return r; }
public void Del(FavoriteEntity entity) { if (entity == null) { throw new ArgumentNullException("entity"); } entity.Status = (int)DataStatus.Deleted; this._favoriteRepository.Delete(entity); //TODO: 账户减少一个fover this._userService.SubFover(entity.User_Id, 1, entity.User_Id); }
public FavoriteInfoResponse FavoriteInfoResponseMapping(FavoriteEntity source, ProductEntity entity) { var target = Mapper.Map<FavoriteEntity, FavoriteInfoResponse>(source); target.FavoriteSourceName = entity == null ? String.Empty : entity.Name; return target; }