コード例 #1
0
 /// <summary>
 /// Gets the property value by name.
 /// </summary>
 /// <param name="entity">The entity.</param>
 /// <param name="propertyName">Name of the property.</param>
 /// <returns></returns>
 public static object GetPropertyValueByName(CurrentProductList entity, string propertyName)
 {
     switch (propertyName)
     {
         case "ProductId":
             return entity.ProductId;
         case "ProductName":
             return entity.ProductName;
     }
     return null;
 }
コード例 #2
0
 ///<summary>
 ///  Returns a Typed CurrentProductListBase Entity 
 ///</summary>
 public virtual CurrentProductListBase Copy()
 {
     //shallow copy entity
     CurrentProductList copy = new CurrentProductList();
         copy.ProductId = this.ProductId;
         copy.ProductName = this.ProductName;
     copy.AcceptChanges();
     return (CurrentProductList)copy;
 }
コード例 #3
0
 ///<summary>
 /// A simple factory method to create a new <see cref="CurrentProductList"/> instance.
 ///</summary>
 ///<param name="_productId"></param>
 ///<param name="_productName"></param>
 public static CurrentProductList CreateCurrentProductList(System.Int32 _productId, System.String _productName)
 {
     CurrentProductList newCurrentProductList = new CurrentProductList();
     newCurrentProductList.ProductId = _productId;
     newCurrentProductList.ProductName = _productName;
     return newCurrentProductList;
 }