当前位置: 代码迷 >> J# >> LINQ变换有没有简单的写法
  详细解决方案

LINQ变换有没有简单的写法

热度:4600   发布时间:2013-02-25 00:00:00.0
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();

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