小编OMA*_*SAK的帖子

使用EntityFramework和`FromSql`的参数

     public List<PostJobListModel> GetPostsByCompanyId(int id, int s, int d, int p)
{
    string command = @"select Id,Title,Cities = STUFF(
     (SELECT  ',' + City.Name  
      FROM City where City.Id in (select Id from LocaitonJobRelationship as ljr where ljr.JobId = PostJob.Id)
      FOR XML PATH ('')), 1, 1, ''),
      Features = STUFF(
     (SELECT  ',' + Feature.Name  
      FROM Feature where Feature.Id in (select FeatureId from FeatureJobRelationship as fjr where fjr.JobId = PostJob.Id and (fjr.CategoryId in (@s,@d,@p) ) )FOR XML PATH('')), 1, 1, '')from PostJob where CompanyId …
Run Code Online (Sandbox Code Playgroud)

.net entity-framework .net-core asp.net-core

9
推荐指数
1
解决办法
1万
查看次数

标签 统计

.net ×1

.net-core ×1

asp.net-core ×1

entity-framework ×1