Posts tagged with “sqlsugar”

SqlSugar: Connection open error . The given key '25971' was not present in the dictionary.

Solution: put charset=utf8mb4 into the connection string.

SQLSugar: How to implement Count(FieldName) and GROUP BY in SQLSugar

            await Db.Queryable<Entity>().Where(_ => _.SampleFieldName== sampleFieldValue)
                .GroupBy("AnothterFieldNameInStringFormat")
                .Select<ResultModel>("AnotherFieldNameInStringFormat, Count(AnotherFieldNameInStringFormat) Total")
                .ToListAsync();