首页 新闻 会员 周边

ASP.NET MVC LINQ to Sql类自动生成的*.designer.cs版本问题.

0
悬赏园豆:30 [已关闭问题]

正在学习NerdDinner_1.0   用的是VS08 SP1+SQL05

项目中创建完数据库后,生成LINQ to Sql类,并把数据库中的表添加进去保存.

生成后的*.designer.cs文件始终与源代码不同.如下版本信息

<auto-generated>
//     此代码由工具生成。
//     运行时版本:2.0.50727.3053
//
//     对此文件的更改可能会导致不正确的行为,并且如果
//     重新生成代码,这些更改将会丢失。
// </auto-generated>

-----------------------------------------------------

源代码文件版本

// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3521
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>

3053与3521区别
还望大家指教.

 

 

 

 

问题补充: 生成完之后,对此NerdDinner.designer.cs文件有改动吗? PDF是没有看出来,但是文件大小就不对.我生成的文件大小12.9 KB 源码14.1 KB 71行的区别 public System.Data.Linq.Table<Dinners> Dinners{get{ return this.GetTable<Dinners>();}} public System.Data.Linq.Table<RSVP> RSVP{get{ return this.GetTable<RSVP>();}} 源码 public System.Data.Linq.Table<Dinner> Dinners{get{ return this.GetTable<Dinner>();}} public System.Data.Linq.Table<RSVP> RSVPs{get{ return this.GetTable<RSVP>();}} 是关系变了. 文件内容缺少了 [Function(Name="dbo.NearestDinners", IsComposable=true)] public IQueryable<NearestDinnersResult> NearestDinners([Parameter(DbType="Real")] System.Nullable<float> lat, [Parameter(Name="long", DbType="Real")] System.Nullable<float> @long) { return this.CreateMethodCallQuery<NearestDinnersResult>(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), lat, @long); } [Function(Name="dbo.DistanceBetween", IsComposable=true)] public System.Nullable<float> DistanceBetween([Parameter(Name="Lat1", DbType="Real")] System.Nullable<float> lat1, [Parameter(Name="Long1", DbType="Real")] System.Nullable<float> long1, [Parameter(Name="Lat2", DbType="Real")] System.Nullable<float> lat2, [Parameter(Name="Long2", DbType="Real")] System.Nullable<float> long2) { return ((System.Nullable<float>)(this.ExecuteMethodCall(this, ((MethodInfo)(MethodInfo.GetCurrentMethod())), lat1, long1, lat2, long2).ReturnValue)); } public partial class NearestDinnersResult== 不太理解.为什么.
Hanks49★ysk的主页 Hanks49★ysk | 初学一级 | 园豆:190
提问于:2009-04-05 08:22
< >
分享
其他回答(1)
0

2.0.50727.3521 好像是Window7上自带的.Net Clr的版本号。例子可能是Scott Gu在Windows7上写的。

Azuresong | 园豆:3565 (老鸟四级) | 2009-04-05 10:48
0

我在Win7上使用的确生成3521

//------------------------------------------------------------------------------
// <auto-generated>
//     This code was generated by a tool.
//     Runtime Version:2.0.50727.3521
//
//     Changes to this file may cause incorrect behavior and will be lost if
//     the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------

李永京 | 园豆:3114 (老鸟四级) | 2009-04-05 11:25
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册