C#
Пример
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
class Program
{
static public void AddValue(this IList<int> myList, int value)
{
myList.Add(value);
}
static void Main(string[] args)
{
List<int> list = new List<int>();
// add value
list.AddValue(10);
}
}
}
C#
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace ConsoleApplication1
{
static class Program
{
static public void AddValue(this IList<int> myList, int value)
{
myList.Add(value);
}
static void Main(string[] args)
{
List<int> list = new List<int>();
// add value
list.AddValue(10);
}
}
}
C#
{
static public void AddValue(this IList<int> myList, int value)
{
myList.Add(value);
}
static void Main(string[] args)
{
List<int> list = new List<int>();
// add value
list.AddValue(10);
}
}