如何从C#中的嵌套列表中删除任何元素 [英] How to remove any element from nested list in C#

查看:198
本文介绍了如何从C#中的嵌套列表中删除任何元素的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

您好



我有一个数据类型为类的列表,它是一个嵌套列表。



Hi

I have one list with data type of class and it is a nested list.

public partial class ProductDetail
    {

        private Class1 lineOfBusinessTypeField;

private Class2 deductibleTypeField;

}







我想删除一个嵌套元素中的一个元素。



我们如何做到这一点请帮助。



提前谢谢

Srishti Gupta



我尝试过:



试图删除从列表中但未完成




I want to remove one element inside one nested element.

How we can do this please help.

Thanks in advance
Srishti Gupta

What I have tried:

Trying to remove from list but not done

推荐答案

您必须在外部类中编写一个remove函数,该函数还会将前一个函数与已删除元素的后继函数重新连接。



也许你只需要将成员设置为null?
You must write a remove function in the outer class which also reconnects the predecessor with the successor of the removed element.

Maybe you only need to set the member to null?


这篇关于如何从C#中的嵌套列表中删除任何元素的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆