///<summary> /// A simple factory method to create a new <see cref="VProductAndDescription"/> instance. ///</summary> ///<param name="_productId"></param> ///<param name="_name"></param> ///<param name="_productModel"></param> ///<param name="_cultureId"></param> ///<param name="_description"></param> public static VProductAndDescription CreateVProductAndDescription(System.Int32 _productId, System.String _name, System.String _productModel, System.String _cultureId, System.String _description) { VProductAndDescription newVProductAndDescription = new VProductAndDescription(); newVProductAndDescription.ProductId = _productId; newVProductAndDescription.Name = _name; newVProductAndDescription.ProductModel = _productModel; newVProductAndDescription.CultureId = _cultureId; newVProductAndDescription.Description = _description; return(newVProductAndDescription); }
///<summary> /// Returns a Typed VProductAndDescriptionBase Entity ///</summary> public virtual VProductAndDescriptionBase Copy() { //shallow copy entity VProductAndDescription copy = new VProductAndDescription(); copy.ProductId = this.ProductId; copy.Name = this.Name; copy.ProductModel = this.ProductModel; copy.CultureId = this.CultureId; copy.Description = this.Description; copy.AcceptChanges(); return((VProductAndDescription)copy); }
/// <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(VProductAndDescription entity, string propertyName) { switch (propertyName) { case "ProductId": return(entity.ProductId); case "Name": return(entity.Name); case "ProductModel": return(entity.ProductModel); case "CultureId": return(entity.CultureId); case "Description": return(entity.Description); } return(null); }
/// <summary> /// Convert a nettiers entity to the ws proxy entity. /// </summary> public static WsProxy.VProductAndDescription Convert(VProductAndDescription item) { WsProxy.VProductAndDescription outItem = new WsProxy.VProductAndDescription(); outItem.ProductId = item.ProductId; outItem.Name = item.Name; outItem.ProductModel = item.ProductModel; outItem.CultureId = item.CultureId; outItem.Description = item.Description; return outItem; }
/// <summary> /// Convert a nettiers collection to the ws proxy collection. /// </summary> public static VProductAndDescription Convert(WsProxy.VProductAndDescription item) { VProductAndDescription outItem = new VProductAndDescription(); outItem.ProductId = item.ProductId; outItem.Name = item.Name; outItem.ProductModel = item.ProductModel; outItem.CultureId = item.CultureId; outItem.Description = item.Description; outItem.AcceptChanges(); return outItem; }
///<summary> /// A simple factory method to create a new <see cref="VProductAndDescription"/> instance. ///</summary> ///<param name="_productId"></param> ///<param name="_name"></param> ///<param name="_productModel"></param> ///<param name="_cultureId"></param> ///<param name="_description"></param> public static VProductAndDescription CreateVProductAndDescription(System.Int32 _productId, System.String _name, System.String _productModel, System.String _cultureId, System.String _description) { VProductAndDescription newVProductAndDescription = new VProductAndDescription(); newVProductAndDescription.ProductId = _productId; newVProductAndDescription.Name = _name; newVProductAndDescription.ProductModel = _productModel; newVProductAndDescription.CultureId = _cultureId; newVProductAndDescription.Description = _description; return newVProductAndDescription; }
/// <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(VProductAndDescription entity, string propertyName) { switch (propertyName) { case "ProductId": return entity.ProductId; case "Name": return entity.Name; case "ProductModel": return entity.ProductModel; case "CultureId": return entity.CultureId; case "Description": return entity.Description; } return null; }
///<summary> /// Returns a Typed VProductAndDescriptionBase Entity ///</summary> public virtual VProductAndDescriptionBase Copy() { //shallow copy entity VProductAndDescription copy = new VProductAndDescription(); copy.ProductId = this.ProductId; copy.Name = this.Name; copy.ProductModel = this.ProductModel; copy.CultureId = this.CultureId; copy.Description = this.Description; copy.AcceptChanges(); return (VProductAndDescription)copy; }
/// <summary> /// Deserialize the mock VProductAndDescription entity from a temporary file. /// </summary> private void Step_7_DeserializeEntity_Generated() { string fileName = "temp_VProductAndDescription.xml"; XmlSerializer mySerializer = new XmlSerializer(typeof(VProductAndDescription)); System.IO.FileStream myFileStream = new System.IO.FileStream(fileName, System.IO.FileMode.Open); mock = (VProductAndDescription) mySerializer.Deserialize(myFileStream); myFileStream.Close(); System.IO.File.Delete(fileName); System.Console.WriteLine("mock correctly deserialized from a temporary file."); }
///<summary> /// Returns a Typed VProductAndDescription Entity with mock values. ///</summary> static public VProductAndDescription CreateMockInstance() { VProductAndDescription mock = new VProductAndDescription(); mock.ProductId = TestUtility.Instance.RandomNumber(); mock.Name = TestUtility.Instance.RandomString(24, false);; mock.ProductModel = TestUtility.Instance.RandomString(24, false);; mock.CultureId = TestUtility.Instance.RandomString(6, false);; mock.Description = TestUtility.Instance.RandomString(199, false);; return (VProductAndDescription)mock; }