public static DmdType ToDmdTypeNoNull(Type type, DmdAppDomain appDomain) { if (type is null) { throw new ArgumentNullException(nameof(type)); } return(appDomain.GetTypeThrow(type)); }
public static DmdType?ToDmdType(Type?type, DmdAppDomain appDomain) { if (type is null) { return(null); } return(appDomain.GetTypeThrow(type)); }
public static DmdType ToDmdType(Type type, DmdAppDomain appDomain) { if ((object)type == null) { return(null); } return(appDomain.GetTypeThrow(type)); }
public static DmdType[] ToDmdTypeNoNull(this IList <Type> types, DmdAppDomain appDomain) { if (types is null) { throw new ArgumentNullException(nameof(types)); } if (types.Count == 0) { return(Array.Empty <DmdType>()); } var newTypes = new DmdType[types.Count]; for (int i = 0; i < newTypes.Length; i++) { newTypes[i] = appDomain.GetTypeThrow(types[i]); } return(newTypes); }
public static DmdType[] ToDmdType(this IList <Type> types, DmdAppDomain appDomain) { if (types == null) { return(null); } if (types.Count == 0) { return(Array.Empty <DmdType>()); } var newTypes = new DmdType[types.Count]; for (int i = 0; i < newTypes.Length; i++) { newTypes[i] = appDomain.GetTypeThrow(types[i]); } return(newTypes); }