csharp attributes as generics constraints
public static void Insert<T>(this IList<T> list, IList<T> items)
{
var attributes = typeof(T).GetCustomAttributes(typeof(InsertableAttribute), true);
if (attributes.Length == 0)
throw new ArgumentException("T does not have attribute InsertableAttribute");
/// Logic.
}
Also in C#:
- how to use variables in c#
- c# new list object
- Read csv file into wpf C#
- unity particle system color
- c# get date without time
- .net core executenonqueryasync transaction
- how to reference scripts in other scenes unity
- loop over enum values
- if entity.is Transient() Update Mvc 5 c#
- c# expandoobject indexer
- unity making homing rocket
- kill child C#
- escape double quotes c#
- open udp socket c#
- eventos c#
- c# typeof
- linq query select top 1 c#
- ignore fakeiteasy
- c# string
- c# length of array
- combine two arraylist c#
- console application in c# ms crm
- while loop c#
- how to trigger event when a com device is connected in c#