예제 #1
0
 private List <T> DataTableToListObject <T>(DataTable result)
 {
     if (result == null || result.Rows.Count < 1)
     {
         return(new List <T>());
     }
     if (typeof(T) == typeof(ApiKey))
     {
         return(ApiKey.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(UserMaster))
     {
         return(UserMaster.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(Permission))
     {
         return(Permission.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(UrlLock))
     {
         return(UrlLock.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(Container))
     {
         return(Container.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(ObjectMetadata))
     {
         return(ObjectMetadata.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(ContainerKeyValuePair))
     {
         return(ContainerKeyValuePair.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(ObjectKeyValuePair))
     {
         return(ObjectKeyValuePair.FromDataTable(result) as List <T>);
     }
     else if (typeof(T) == typeof(AuditLogEntry))
     {
         return(AuditLogEntry.FromDataTable(result) as List <T>);
     }
     throw new ArgumentException("Unknown object type: " + typeof(T).Name);
 }