internal static object Create(Type objectType, object criteria) { var dp = new DataPortal <object>(); try { return(dp.DoCreateAsync(objectType, criteria, true).Result); } catch (AggregateException ex) { if (ex.InnerExceptions.Count > 0) { throw ex.InnerExceptions[0]; } else { throw; } } }