反编译 NopCommerce 的 C# XML 插件后出错
当我反编译我的代码时出现错误。这是我不明白的语法,我不知道如何修复它,你能帮助我吗?
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?
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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论