| Mention some of ref struct restrictions in csharp? Below are some restrictions which prevent a ref struct value ends up on heap at runtime:- (1)We can not use ref struct as a type argument. (2)We can not use ref struct to implement interfaces. (3)A ref struct variable can not be used in iterators. (4)We can not boxed ref struct to System.ValueType or System.Object. (5)We can not captured ref struct variable by a lambda expression or local function. (6)We can not used ref struct variable in an async methods. But we can use ref struct variables in synchronous methods. (7)We can not use ref struct as element type of an array. (8)We can not use ref struct to declare type of field of a class or a struct. But a ref struct can type a field of ref struct. | | |