78
1
// Author : Tech Point Fundamentals
2
// Website : www.techpointfunda.com
3
// Demo : Interface Partial Methods Demo in C# 8
4
5
using System;
6
7
// Declaring delegate
8
public delegate void PartialMethoDelegate();
9
10
public partial interface IUser
11
{
12
partial void GetUserName(); // Partial method declaration
13
partial void GetUserName(ref string name, int userId); // Method overloading
14
15
static partial void GetUserEmail(); // Partial method declaration
16
partial void GetUserPhoneNumber(); // Partial method declared but not implemented
17
18
partial void GetdataTypeName<T>(T type);
19
20
partial void GetUserName() // Partial method implementation in same partial type
21
{
22
Console.WriteLine("Tech Point Fundamentals");
23
}
24
Cached Result