把没用的帮我去掉就可以了,另外,除了SQLMetal外,有没有什么图形化的工具可以将这些Atrribute写到XML文件中?
[Table(Name = "dbo.[Order Details]")]
public partial class Order_Details : INotifyPropertyChanging, INotifyPropertyChanged
{ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); private int _OrderID; private int _ProductID; private decimal _UnitPrice; private short _Quantity; private float _Discount; private EntityRef<Orders> _Orders; private EntityRef<Products> _Products; #region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnOrderIDChanging(int value);
partial void OnOrderIDChanged();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnUnitPriceChanging(decimal value);
partial void OnUnitPriceChanged();
partial void OnQuantityChanging(short value);
partial void OnQuantityChanged();
partial void OnDiscountChanging(float value);
partial void OnDiscountChanged();
#endregion public Order_Details()
{
this._Orders = default(EntityRef<Orders>);
this._Products = default(EntityRef<Products>);
OnCreated();
} [Column(Storage = "_OrderID", DbType = "Int NOT NULL", IsPrimaryKey = true)]
public int OrderID
{
get
{
return this._OrderID;
}
set
{
if ((this._OrderID != value))
{
if (this._Orders.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnOrderIDChanging(value);
this.SendPropertyChanging();
this._OrderID = value;
this.SendPropertyChanged("OrderID");
this.OnOrderIDChanged();
}
}
} [Column(Storage = "_ProductID", DbType = "Int NOT NULL", IsPrimaryKey = true)]
public int ProductID
{
get
{
return this._ProductID;
}
set
{
if ((this._ProductID != value))
{
if (this._Products.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductIDChanging(value);
this.SendPropertyChanging();
this._ProductID = value;
this.SendPropertyChanged("ProductID");
this.OnProductIDChanged();
}
}
} [Column(Storage = "_UnitPrice", DbType = "Money NOT NULL")]
public decimal UnitPrice
{
get
{
return this._UnitPrice;
}
set
{
if ((this._UnitPrice != value))
{
this.OnUnitPriceChanging(value);
this.SendPropertyChanging();
this._UnitPrice = value;
this.SendPropertyChanged("UnitPrice");
this.OnUnitPriceChanged();
}
}
} [Column(Storage = "_Quantity", DbType = "SmallInt NOT NULL")]
public short Quantity
{
get
{
return this._Quantity;
}
set
{
if ((this._Quantity != value))
{
this.OnQuantityChanging(value);
this.SendPropertyChanging();
this._Quantity = value;
this.SendPropertyChanged("Quantity");
this.OnQuantityChanged();
}
}
} [Column(Storage = "_Discount", DbType = "Real NOT NULL")]
public float Discount
{
get
{
return this._Discount;
}
set
{
if ((this._Discount != value))
{
this.OnDiscountChanging(value);
this.SendPropertyChanging();
this._Discount = value;
this.SendPropertyChanged("Discount");
this.OnDiscountChanged();
}
}
}
[Table(Name = "dbo.[Order Details]")]
public partial class Order_Details : INotifyPropertyChanging, INotifyPropertyChanged
{ private static PropertyChangingEventArgs emptyChangingEventArgs = new PropertyChangingEventArgs(String.Empty); private int _OrderID; private int _ProductID; private decimal _UnitPrice; private short _Quantity; private float _Discount; private EntityRef<Orders> _Orders; private EntityRef<Products> _Products; #region Extensibility Method Definitions
partial void OnLoaded();
partial void OnValidate(System.Data.Linq.ChangeAction action);
partial void OnCreated();
partial void OnOrderIDChanging(int value);
partial void OnOrderIDChanged();
partial void OnProductIDChanging(int value);
partial void OnProductIDChanged();
partial void OnUnitPriceChanging(decimal value);
partial void OnUnitPriceChanged();
partial void OnQuantityChanging(short value);
partial void OnQuantityChanged();
partial void OnDiscountChanging(float value);
partial void OnDiscountChanged();
#endregion public Order_Details()
{
this._Orders = default(EntityRef<Orders>);
this._Products = default(EntityRef<Products>);
OnCreated();
} [Column(Storage = "_OrderID", DbType = "Int NOT NULL", IsPrimaryKey = true)]
public int OrderID
{
get
{
return this._OrderID;
}
set
{
if ((this._OrderID != value))
{
if (this._Orders.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnOrderIDChanging(value);
this.SendPropertyChanging();
this._OrderID = value;
this.SendPropertyChanged("OrderID");
this.OnOrderIDChanged();
}
}
} [Column(Storage = "_ProductID", DbType = "Int NOT NULL", IsPrimaryKey = true)]
public int ProductID
{
get
{
return this._ProductID;
}
set
{
if ((this._ProductID != value))
{
if (this._Products.HasLoadedOrAssignedValue)
{
throw new System.Data.Linq.ForeignKeyReferenceAlreadyHasValueException();
}
this.OnProductIDChanging(value);
this.SendPropertyChanging();
this._ProductID = value;
this.SendPropertyChanged("ProductID");
this.OnProductIDChanged();
}
}
} [Column(Storage = "_UnitPrice", DbType = "Money NOT NULL")]
public decimal UnitPrice
{
get
{
return this._UnitPrice;
}
set
{
if ((this._UnitPrice != value))
{
this.OnUnitPriceChanging(value);
this.SendPropertyChanging();
this._UnitPrice = value;
this.SendPropertyChanged("UnitPrice");
this.OnUnitPriceChanged();
}
}
} [Column(Storage = "_Quantity", DbType = "SmallInt NOT NULL")]
public short Quantity
{
get
{
return this._Quantity;
}
set
{
if ((this._Quantity != value))
{
this.OnQuantityChanging(value);
this.SendPropertyChanging();
this._Quantity = value;
this.SendPropertyChanged("Quantity");
this.OnQuantityChanged();
}
}
} [Column(Storage = "_Discount", DbType = "Real NOT NULL")]
public float Discount
{
get
{
return this._Discount;
}
set
{
if ((this._Discount != value))
{
this.OnDiscountChanging(value);
this.SendPropertyChanging();
this._Discount = value;
this.SendPropertyChanged("Discount");
this.OnDiscountChanged();
}
}
}
解决方案 »
- 如何判断n个数字是否有连续
- 一个dataset 转换成xml的问题
- Repeater 控件的问题
- 网上找了个放大镜的代码.IE7下移动很缓慢.IE6没问题.有谁能帮我看下吗
- gridview如何实现修改后返回本页?
- 当弹出框逐渐消失时,鼠标移动到框上时又立马停止消失并完全显示。如何实现
- 如何利用正则获取所有批配的超级连接
- 我点击Button先进行一些处理,然后弹出一个提示窗口,并定位到另一页,我这样为什么不行!
- 晕死,真tmd,装完tomcat 5.0,我的iis就不好使了,卸载了tomcat 5.0,iis依旧不好使。怎么办?有人知道吗?
- 百度 GOOLE 关键词分析 是如何做到的呢?
- gridview里面编辑怎么写(vb2005.net)
- 为过程或函数...指定的参数太多
就是数据库表到对象的“翻译”,和表结构是一一对应的.如果你用的是自己的实体类,那你根据没必要生成Linq to sql类了,直接用Linq to Object操作好咯