[英]How to select the records with the particular date day or today's date and increment highest sequence number (int or id) in LINQ?
I need to select the records with the particular date day and increment highest sequence number (int or id) in LINQ, how todo this?我需要 select 记录具有特定日期的日期,并在 LINQ 中增加最高序列号(int 或 id),该怎么做?
Select your date day or DateTime.UtcNow.Date or DateTime.Today Select 您的日期日期或DateTime.UtcNow.Date或DateTime.Today
_Dbcontext.DbTable.SequenceIntegerColumn = _Dbcontext.DbTable.Where(x => x
.DateColumn.Value.Day == DateTime.UtcNow.Date)
.Max(n => n.SequenceIntegerColumn) + 1;
or或者
_Dbcontext.DbTable.SequenceIntegerColumn = _Dbcontext.DbTable.Where(x => x
.DateColumn.Value.Day == DateTime.Today)
.Max(n => n.SequenceIntegerColumn) + 1;
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.