反编译 NopCommerce 的 C# XML 插件后出错

发布于 2025-01-11 19:11:32 字数 2657 浏览 0 评论 0原文

当我反编译我的代码时出现错误。这是我不明白的语法,我不知道如何修复它,你能帮助我吗?

在此处输入图片说明

在此处输入图片描述

输入图片描述这里

public void performrolemapping(Customer customer, bool newcustomer)
    {
        if (!newcustomer)
        {
            IList<CustomerRole> customerRoles = this._customerservice.GetCustomerRoles(customer, false);
            Func<CustomerRole, bool> u003cu003e9_170 = ParagonAuthenticationController.<> c.<> 9__17_0;
            if (u003cu003e9_170 == null)
            {
                u003cu003e9_170 = new Func<CustomerRole, bool>(ParagonAuthenticationController.<> c.<> 9, (CustomerRole cr) => cr.get_SystemName() == NopCustomerDefaults.get_RegisteredRoleName());
                ParagonAuthenticationController.<> c.<> 9__17_0 = u003cu003e9_170;
            }
            if ((object)Enumerable.FirstOrDefault<CustomerRole>(customerRoles, u003cu003e9_170) != (object)null)
            {
                return;
            }
        }
        IList<CustomerRole> allCustomerRoles = this._customerservice.GetAllCustomerRoles(true);
        List<CustomerRole> list = new List<CustomerRole>();
        foreach (CustomerRole allCustomerRole in allCustomerRoles)
        {
            list.Add(allCustomerRole);
        }
        foreach (CustomerRole customerRole in list)
        {
            if (customerRole.Name != "Registered")
            {
                continue;
            }
            ICustomerService customerService = this._customerservice;
            CustomerCustomerRoleMapping customerCustomerRoleMapping = new CustomerCustomerRoleMapping();
            customerCustomerRoleMapping.CustomerId = customer.Id;
            customerCustomerRoleMapping.CustomerRoleId = customerRole.Id;
            customerService.AddCustomerRoleMapping(customerCustomerRoleMapping);
            return;
        }
    }

    public static string RandomString()
    {
        ParagonAuthenticationController.<> c__DisplayClass18_0 variable = null;
        int num = 40;
        Random random = new Random();
        return new string(Enumerable.ToArray<char>(Enumerable.Select<string, char>(Enumerable.Repeat<string>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*+", num), new Func<string, char>(variable, (string s) => s[this.random.Next(s.get_Length())]))));
    }

I get errors when I decompile my code. It's a syntax I don't understand and I don't know how to fix it, can you help me?

enter image description here

enter image description here

enter image description here

public void performrolemapping(Customer customer, bool newcustomer)
    {
        if (!newcustomer)
        {
            IList<CustomerRole> customerRoles = this._customerservice.GetCustomerRoles(customer, false);
            Func<CustomerRole, bool> u003cu003e9_170 = ParagonAuthenticationController.<> c.<> 9__17_0;
            if (u003cu003e9_170 == null)
            {
                u003cu003e9_170 = new Func<CustomerRole, bool>(ParagonAuthenticationController.<> c.<> 9, (CustomerRole cr) => cr.get_SystemName() == NopCustomerDefaults.get_RegisteredRoleName());
                ParagonAuthenticationController.<> c.<> 9__17_0 = u003cu003e9_170;
            }
            if ((object)Enumerable.FirstOrDefault<CustomerRole>(customerRoles, u003cu003e9_170) != (object)null)
            {
                return;
            }
        }
        IList<CustomerRole> allCustomerRoles = this._customerservice.GetAllCustomerRoles(true);
        List<CustomerRole> list = new List<CustomerRole>();
        foreach (CustomerRole allCustomerRole in allCustomerRoles)
        {
            list.Add(allCustomerRole);
        }
        foreach (CustomerRole customerRole in list)
        {
            if (customerRole.Name != "Registered")
            {
                continue;
            }
            ICustomerService customerService = this._customerservice;
            CustomerCustomerRoleMapping customerCustomerRoleMapping = new CustomerCustomerRoleMapping();
            customerCustomerRoleMapping.CustomerId = customer.Id;
            customerCustomerRoleMapping.CustomerRoleId = customerRole.Id;
            customerService.AddCustomerRoleMapping(customerCustomerRoleMapping);
            return;
        }
    }

    public static string RandomString()
    {
        ParagonAuthenticationController.<> c__DisplayClass18_0 variable = null;
        int num = 40;
        Random random = new Random();
        return new string(Enumerable.ToArray<char>(Enumerable.Select<string, char>(Enumerable.Repeat<string>("abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890!@#$%^&*+", num), new Func<string, char>(variable, (string s) => s[this.random.Next(s.get_Length())]))));
    }

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文