yasser777 / nettiers

Automatically exported from code.google.com/p/nettiers
0 stars 0 forks source link

In CodeSmith if we are setting IncludeWCFDataAttributes = TRUE then it does not generate Serializable attribute for base classes even though we set SerializableEntityState = TRUE in CodeSmith. #258

Open GoogleCodeExporter opened 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?
1.Double click on NetTiers.cst template.It opens CodeSmith property window.
2.Specify a SampleDB database in ChooseSourceDatabase property.
3.Specify IncludeComponentLayer = ServiceLayer
4.Specify IncludeWCFDataAttributes = True
5.Specify SerializeEntityState = True
6.Click on Generate button. It generated Data Layer for specified Database.
7.Lets say sample database has a table called "Service".
8.It generates a file called "ServiceBase.generated.cs" contails

Actual Output:

///<summary>
// An object representation of the 'State' table. [No description found 
the database]   
///</summary>
[DataContract]
[DataObject, CLSCompliant(true)]
public abstract partial class StateBase : EntityBase, IState, 
IEntityId<StateKey>, System.IComparable, System.ICloneable, ICloneableEx, 
IEditableObject, IComponent, INotifyPropertyChanged
{       
      #region Variable Declarations
      --------
      --------
}

Excepcted Output:
It should generate Serializable attribute also. but its not generating.

///</summary>
[DataContract]
[Serializable, DataObject]
[CLSCompliant(true)]
public abstract partial class StateBase : EntityBase, IState, 
IEntityId<StateKey>, System.IComparable, System.ICloneable, ICloneableEx, 
IEditableObject, IComponent, INotifyPropertyChanged
{       
      #region Variable Declarations
      --------
      --------
}

Problem with not having Serialization attribute:
> After calling DeepCopy() method on Service object, it throws following 
exception:

Type 'SampleDB.Entities.ServiceBase' in Assembly 'SampleDB.Entities, 
Version=0.0.0.77, Culture=neutral, PublicKeyToken=null' is not marked as 
serializable.

What is the expected output? What do you see instead?
DeepCopy() is not working. DeepCopy() should work.

What version of .netTiers and CodeSmith are you using?
Code Smith Profession 5.1.6
Nettiers 2.3

Please use labels and text to provide additional information.

Original issue reported on code.google.com by d.Kushw...@gmail.com on 1 Oct 2009 at 1:40

Attachments:

GoogleCodeExporter commented 9 years ago

Original comment by bniemyjski on 21 Sep 2010 at 8:34