0
How to create custom return type in c#
Hi there i want to know that hpw can i create custum return type in c#
3 Answers
+ 7
what do you mean?
you can return an 'custom' object but you can't define your own primitive data types
+ 3
Hi, I think you would want to create a method, though what would you like to return?
+ 1
Create an object or strict to hold the data. then create a method with the return type of that object/struct. Then return the a created object/struct of your created type.
For example let's say I made the class person. My method would look like this.
public person getPerson () {
return new person() ;
}