title: storing enum to database in entity
body: <p>i am trying to pass a dropdown selected value to database 
  my datacontracts has the following code</p>
  
  <pre><code>      public EnumTypes.RegardingObjectType RegardingObjectType { get; set; }
      public Guid RegardingObjectId { get; set; }
  </code></pre>
  
  <p>enumtypes.cs has the following</p>
  
  <pre><code>    public class EnumTypes
  {
  
      public enum RegardingObjectType
      {
          UnknownOrNone = 0,
          Account = 1,
          Cellsite = 2,
  </code></pre>
  
  <p>eventdal.cs has the following</p>
  
  <pre><code>       private t_Event MapEventToEntity(Event newevent, t_Event eventToBeChanged)
      {
     eventToBeChanged.RegardingObjectType = int.Parse(newevent.RegardingObjectType.ToString());
  </code></pre>
  
  <p>it builds fine but getting exception while running</p>