using AutoMapper; using DSWeb.Areas.Dispatch.DB; using DSWeb.Dispatch.DAL; using System; using System.Collections.Generic; using System.Linq; using System.Web; namespace DSWeb.Areas.Dispatch.Models { public class DriverAuditViewModel { public string GID { get; set; } public string DriverName { get; set; } public string Tel { get; set; } public bool IsAudit { get; set; } public string AuditStatsName { get; set; } public string RegName { get; set; } public string InfoClient { get; set; } } public static class DriverAuditViewModelExt { private static InfoClientDAL infoClientDAL = new InfoClientDAL(); public static DriverAuditViewModel AsDriverAuditViewModel(this DriverInfo model) { return Mapper.Map(model); } public static List AsDriverAuditViewModelList(this IEnumerable model) { return Mapper.Map, List>(model); } public static DriverInfo AsDriverModel(this DriverAuditViewModel model) { return Mapper.Map(model); } public static DriverInfo AsDriverModel(this DriverAuditViewModel model, DriverInfo dest) { return Mapper.Map(model, dest); } } }