大连融科 WMS
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
1.1 KiB

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;
using System.Configuration;
using System.Threading;
using SiaSun.LMS.Model;
namespace SiaSun.LMS.Common
{
public static class ModelConverter
{
/// <summary>
/// ����ʵ�弯����
/// </summary>
/// <typeparam name="T">ʵ������</typeparam>
/// <param name="objectTList">�����˷��ص�ObjectTList</param>
/// <returns>ʵ�弯</returns>
public static List<T> ToList<T>(this ObjectList objectTList)
{
List<T> result = new List<T>();
IList<object> list = objectTList.RequestObject;
foreach (object obj in list)
{
result.Add((T)obj);
}
return result;
}
/// <summary>
/// ����ʵ������
/// </summary>
/// <typeparam name="T">ʵ������</typeparam>
/// <param name="objectT">�����˷��ص�ObjectT</param>
/// <returns>ʵ��</returns>
public static T ToModel<T>(this ObjectT objectT)
{
return (T)objectT.RequestObject;
}
}
}