闲聊

用.NET EF Core对Mysql进行INNER JOIN多表查询

之前在网上找了好多资料,也没有比较好的回答

我要写这样一个sql语句:

SELECT
*
FROM
a
JOIN b ON a.PID = b.ID
JOIN c ON a.P2ID = c.ID
JOIN d ON c.PID = d.ID
AND c.P2ID = d.ID2

在.NET EF Core中我是这样做的:

IQueryable<a> cartIQ = from s in _dBContext.a select s;
cartIQ = cartIQ.Where(c => c.ID == param);
var cartList = cartIQ.Join(_dBContext.b, prodCart => prodCart.ProdId, prod => prod.Id, (prodCart, prod) => new { c = prodCart, b = prod })
.Join(_dBContext.SkuInfo, prod => prod.c.SkuId, sku => sku.SkuId, (prod, sku) => new { prod.c, prod.b, SkuInfo = sku })
.Join(_dBContext.SkuColorPic, t => new { t.SkuInfo.ProdId, t.SkuInfo.ColorId }, cpic => new { cpic.ProdId, cpic.ColorId }, (t, cpic) => new { t.c, t.b, t.SkuInfo, SkuColorPic = cpic });

闲聊

美少女万华镜5通关HE

其实没有完全完成,但是故事差不多结束了,男主被拉回了人偶之间开始了没羞没臊的治疗过程。全程没有HCG,前提是你不变心。

奉上下载链接:中文汉化版

链接:https://pan.baidu.com/s/1rze-D_Hgz2SBAfy0zsbdKA
提取码:9s17
zpw: 菜菜山萌世歌吧

闲聊

干活干活

主要还是处理moc3模型动作影响的东西,framework里面还是有很多方法需要理解,写的很工整,但是学习是需要时间的。。。

闲聊

新玩具到了

车内空气清新剂,我也说不上来是啥味道,有点诡异,可能是味道太重了吧。还有另一种味道,回头买个别的试试。

闲聊

Macbook Pro 2020!

这几天切换开发环境到Macbook上,确实遇到很多之前没想过的问题。
比如安装brew啊之类的,真是好麻烦啊///

所以本周更新的干货可能不是很多,而且我还在适应新的开发环境,有点不太数量啊emmm

闲聊

fu到啦

今天收到了年初预订的超大miku玩具了!

有一说一,做工堪忧,有好多线头,我剪掉了。

这是在批站会员购买的,所以速度还是可以的,我和媳妇说我要放车里,后座上系好安全带,当孩子放着哈哈!

闲聊

webpack真是个好东西

之前一点也不知道这个玩意,我一直以为min.js是用比较简单去掉注释和空格做的,我真是孤陋寡闻啊!

我在网上查了好多资料,原来js是可以这样进行合并,并组成新的sdk。

通过wp插件真的是学到之前没玩过的东西,有意思!

闲聊

给MI6X MIKU ROOT

好久没用这个手机了,要是说起来,我买回来的时候就没怎么折腾它,卖了IPHONE7 等价换初音这种事情,真的划算吗?

这次更换可Root的开发版,其实是为了可以进行Android Auto的研究,因为在网上看了一下,Android Auto限制非常多,和Carplay一样,你又没有Carplay那么多软件支持,死撑什么呢,也不知道,不过有一说一,国外支持Android Auto的软件其实挺多的,但是用得上不?

为啥折腾Android Auto ,其实要从上个月我自己徒手装车机开始说起

这辆凯迪拉克ATSL被我折腾的够呛啦~

不愧是痛车! 但是装完了原厂车机,又没有Carplay怎么搞呢…

来Android Auto吧!

Android Auto主要需要一个软件进行sqlite3库的改写,我看YouTube上的教程大部分人推荐
AA Phenotype Patcher
,我下载了以后看了一下,这个软件可以改写com.google.android.gms.car的信息

--  Apps which will be added to whitelist: --
  - 虾米音乐 (fm.xiami.main)
  - AA Mirror (com.github.slashmax.aamirror)
  - 高德地图 (com.autonavi.minimap)

--  chmod 775 sqlite3  --
 OutputStream:
  chmod 775 /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3
--  end chmod 775 sqlite3  --

-- Drop Triggers  --
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DROP TRIGGER after_delete;'

--  DELETE old Flags  --
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM Flags WHERE name="app_white_list";'

--  run SQL method #1  --
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 234, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 230, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 234, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 230, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 234, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 230, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);'
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'CREATE TRIGGER after_delete AFTER DELETE
  ON Flags
  BEGIN
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 230, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car", 234, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car"), 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 230, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car", 234, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", (SELECT version FROM Packages WHERE packageName="com.google.android.gms.car#car"), 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 230, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  INSERT OR REPLACE INTO Flags (packageName, version, flagType, partitionId, user, name, stringVal, committed) VALUES ("com.google.android.gms.car#car_setup", 234, 0, 0, "", "app_white_list", "fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap",1);
  END;'
--  end SQL method #1  --

--  Check (1/3)  --
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'SELECT * FROM Flags WHERE name="app_white_list";'
 InputStream:
  com.google.android.gms.car#car_setup|230|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car#car_setup|234|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car#car|230|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car#car|234|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car|230|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car|234|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car|247|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
--  Check (2/3)  --
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'DELETE FROM Flags WHERE name="app_white_list";'
--  Check (3/3)  --
 OutputStream:
  /data/user/0/pl.eselter.aaphenotypepatcher/sqlite3 /data/data/com.google.android.gms/databases/phenotype.db 'SELECT * FROM Flags WHERE name="app_white_list";'
 InputStream:
  com.google.android.gms.car#car_setup|230|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car#car_setup|234|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car#car|230|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car#car|234|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car|230|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car|234|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1
  com.google.android.gms.car|247|0|0||app_white_list||||fm.xiami.main,com.github.slashmax.aamirror,com.autonavi.minimap||1

--  Check seems OK :)  --

通过这种方式可能会让Android Auto应用中增加指定的APP,网上说AA Phenotype Patcher需要配合AAMirror使用,因为比较晚,明天去车上试试,顺便拍几个照片!