How do I remove an object directly from an IGrouping IGrouping<DateTime, VMAppointment>
?
The only way I know of currently is to generate a new IGrouping without the concering element, but I don't like this way because it causes some trouble within my application.
Any ideas?
The first parameter is an object iteration or array The second parameter is an index or a property name of an object with the delete method, You can remove a property from an object or element from an array. If you are removing an property from object, It trigger the view updates reactively.
splice is an inbuilt method in an array, used to remove an element from an array and return a new array with the removed list. the start index is a starting index at which the array index element is deleted. count of elements is the number of elements to be removed from a start index
Notice that to access an IGrouping<TKey,TElement> object's sequence of values, you simply use the IGrouping<TKey,TElement> variable itself. // Get an IGrouping object. IGrouping<System.Reflection.MemberTypes, System.Reflection.MemberInfo> group = typeof(String).GetMembers (). GroupBy (member => member.MemberType).
splice is an inbuilt method in an array, used to remove an element from an array and return a new array with the removed list. the start index is a starting index at which the array index element is deleted. count of elements is the number of elements to be removed from a start index So, you can be removed with splice using index and object
No, there's no way to mutate an IGrouping<,>
, at least in general - and even if you knew the concrete type, I don't believe any of the implementations exposed by the .NET framework allow the group to be mutated.
Presumably the grouping is the result of some query - so if possible, change the original query to exclude the values you aren't interested in.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With