You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The sql statement I want to implement is select log.OPUserId as PutStaffId,max(log.OPUserName) as PutStaffName,**group_concat(log.Id)** as PutLogIdsStr,sum(log.Point) as Point from PromotionAccountPutLog log where .. group by log.OPUserId
var statisticsList = (from log in session.Query<PromotionAccountPutLog>().Where(w => ...)
group log by log.OPUserId into g
select new PutStaffCommissionStatisticsDto
{
PutLogIdsStr = string.Join(',', g.Select(s => s.Id)),
//PutLogIdsStr = g.GroupConcat(x => x.Id),
PutStaffId = g.Key,
PutStaffName = g.Max(x => x.OPUserName),
Point = g.Sum(s => s.Point),
...
}).ToList();
then i try [LinqExtensionMethod("group_concat")], but throw "must be reducible node"
public static class CustomLinqExtensions
{
[LinqExtensionMethod("group_concat")]
public static string GroupConcat<TSource, TResult>(this IEnumerable<TSource> source, Func<TSource, TResult> selector)
{
throw new NotImplementedException();
}
}
nhiberante 5.4.2, mysql 8.0.31
The text was updated successfully, but these errors were encountered:
efcore supports string.join from version 7.0,and MySql.EntityFrameworkCore 7.0.0 can transate string.Join(',', g.Select(s => s.Id)) with mysql funcation group_concat.
bellow Function Mappings of the Microsoft SQL Server Provider: https://learn.microsoft.com/en-us/ef/core/providers/sql-server/functions
The sql statement I want to implement is
select log.OPUserId as PutStaffId,max(log.OPUserName) as PutStaffName,**group_concat(log.Id)** as PutLogIdsStr,sum(log.Point) as Point from PromotionAccountPutLog log where .. group by log.OPUserId
then i try [LinqExtensionMethod("group_concat")], but throw "must be reducible node"
nhiberante 5.4.2, mysql 8.0.31
The text was updated successfully, but these errors were encountered: