MyException - 我的异常网
当前位置:我的异常网» J# » LINQ转换有没有简单的写法,该怎么处理

LINQ转换有没有简单的写法,该怎么处理

www.MyException.Cn  网友分享于:2013-01-26  浏览:8次
LINQ转换有没有简单的写法
    .Select(z => new Tranlit.DAL.TablesMapping.V_SX_CYInformationInfo
                 {
                     AutoId = z.b.AutoId,
                     Original = z.b.Original,
                     Publisher = z.b.Publisher,
                     Title = z.b.Title,
                     Contents = z.b.Contents,
                     MainPrompt = z.b.MainPrompt,
                     Created = z.b.Created,
                     Hit = z.b.Hit,
                     ShareCount = z.b.ShareCount,
                     Review = z.b.Review,
                     Relay = z.b.Relay,
                     IsSecret = z.b.IsSecret,
                     IsDraft = z.b.IsDraft,
                     CategoryId = z.b.CategoryId,
                     ChannelId = z.b.ChannelId,
                     ColumnId = z.b.ColumnId,
                     IsSynchroUnion = z.b.IsSynchroUnion,
                     IsSynchroView = z.b.IsSynchroView,
                     IsConfirm = z.b.IsConfirm,
                     Source = z.b.Source
                 }).ToList();

如上面这段代码 ,每个字段都要赋值,有没有简单点的写法(解决匿名对象问题)
------解决方案--------------------
想简单 ,那你用代码生成器吧
------解决方案--------------------
想简单 ,那你用代码生成器吧

文章评论

软件开发程序错误异常ExceptionCopyright © 2009-2015 MyException 版权所有