Elight.Utility/Extension/SqlSugar/ExtMethods.cs

(开头部分) 23KB

这里只显示每个文件的开头 60 行。登录后可以解锁完整代码。

using SqlSugar;
using System;
using System.Collections.Generic;
using System.Text;

namespace Elight.Utility.Extension.SqlSugar
{
    public class ExtMethods
    {
        public static List<SqlFuncExternal> GetExpMethods
        {
            get
            {
                var expMethods = new List<SqlFuncExternal>();
                //abs
                expMethods.Add(new SqlFuncExternal()
                {
                    UniqueMethodName = "Abs",
                    MethodValue = (expInfo, dbType, expContext) =>
                    {
                        if (dbType == DbType.MySql)
                            return string.Format("ABS({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.SqlServer)
                            return string.Format("ABS({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.PostgreSQL)
                            return string.Format("abs({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.Oracle)
                            return string.Format("ABS({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.Sqlite)
                            return string.Format("ABS({0})", expInfo.Args[0].MemberName);
                        else
                            throw new Exception("未实现");
                    }
                });
                //sin
                expMethods.Add(new SqlFuncExternal()
                {
                    UniqueMethodName = "Sin",
                    MethodValue = (expInfo, dbType, expContext) =>
                    {
                        if (dbType == DbType.MySql)
                            return string.Format("SIN({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.SqlServer)
                            return string.Format("SIN({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.PostgreSQL)
                            return string.Format("sin({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.Oracle)
                            return string.Format("SIN({0})", expInfo.Args[0].MemberName);
                        else if (dbType == DbType.Sqlite)
                            return string.Format("SIN({0})", expInfo.Args[0].MemberName);
                        else
                            throw new Exception("未实现");
                    }
                });
                //cos
                expMethods.Add(new SqlFuncExternal()
                {
                    UniqueMethodName = "Cos",
                    MethodValue = (expInfo, dbType, expContext) =>
                    {
后面还有 260 行代码,解锁后查看完整代码

24 小时内免费解锁 3 个项目,之后 1 算力/个。 规则说明

AI 解读 AI

登录后可用,每次 10 算力,解读结果公开显示在下面。

还没有人解读过这个文件。