EF.Functions是EF Core提供的函式功能

*人丑就该多读书*發表於2024-05-13

using Microsoft.EntityFrameworkCore;
     
EF.Functions.Like();
EF.Functions.Contains();
EF.Functions.DateDiffDay();
EF.Functions.DateDiffHour();
EF.Functions.DateDiffMinute();
EF.Functions.DateDiffMonth();
EF.Functions.DateDiffSecond();
EF.Functions.DateDiffYear();
EF.Functions.IsDate();

public void GetUserinfo() { _dbContext.UserInfos.Where(c => EF.Functions.Like(c.UserName, "test%")).ToList(); }

  

相關文章