source/Repid.Core/DbSet/Basic/BasicMenuDbSet.cs

(开头部分) 3KB

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

// <autogenerated>
//   This file was generated by T4 code generator Core.tt.
//   Any changes made to this file manually will be lost next time the file is regenerated.
// </autogenerated>

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Entity;
using Repid.Entity.Basic;

namespace Repid.Core.DbSet.Basic
{
    internal partial class BasicMenuDbSet : TreeDbSet<BasicMenu>
    {
        internal List<BasicMenu> EffectiveAll()
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendLine("SELECT M.ID");
            sql.AppendLine(",M.InsertTime");
            sql.AppendLine(",M.UpdateTime");
            sql.AppendLine(",M.Path");
            sql.AppendLine(",M.Pid");
            sql.AppendLine(",M.Sequence");
            sql.AppendLine(",M.Name");
            sql.AppendLine(",M.Icon");
            sql.AppendLine(",M.Type");
            sql.AppendLine(",M.Module");
            sql.AppendLine(",M.Tag");
            sql.AppendLine(",M.Link");
            sql.AppendLine(",M.IsEnabled");
            sql.AppendLine("FROM Basic_Menu AS M");
            sql.AppendLine("INNER JOIN Basic_MenuFunction AS MF ON MF.MenuID = M.ID");
            sql.AppendLine("INNER JOIN Basic_Function AS F ON F.ID = MF.FunctionID");
            sql.AppendLine("WHERE M.IsEnabled = 1");
            sql.AppendLine("AND F.Purview = 'VIEW'");
            sql.AppendLine("ORDER BY M.Sequence ASC");

            return dbContext.Dapper.Query<BasicMenu>(sql.ToString()).ToList();
        }

        internal List<BasicMenu> EffectiveByUserId(string userId)
        {
            StringBuilder sql = new StringBuilder();

            sql.AppendLine("SELECT DISTINCT M.ID");
            sql.AppendLine(",M.InsertTime");
            sql.AppendLine(",M.UpdateTime");
            sql.AppendLine(",M.Path");
            sql.AppendLine(",M.Pid");
            sql.AppendLine(",M.Sequence");
            sql.AppendLine(",M.Name");
            sql.AppendLine(",M.Icon");
            sql.AppendLine(",M.Type");
            sql.AppendLine(",M.Module");
            sql.AppendLine(",M.Tag");
            sql.AppendLine(",M.Link");
            sql.AppendLine(",M.IsEnabled");
后面还有 16 行代码,解锁后查看完整代码

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

AI 解读 AI

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

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