public static MVC.CounterAction MapBusinessToMvc(BL.CounterAction source)
        {
            if(source == null)
                    return null;
                MVC.CounterAction target = new MVC.CounterAction();
                    target.CounterActionId = source.Id;
                target.CounterActionVersion = source.Version;
                target.CounterActionText = source.Text;

                return target;
        }
        public static MVC.CounterAction MapBusinessToMvc(BL.CounterAction source)
        {
            if (source == null)
            {
                return(null);
            }
            MVC.CounterAction target = new MVC.CounterAction();
            target.CounterActionId      = source.Id;
            target.CounterActionVersion = source.Version;
            target.CounterActionText    = source.Text;


            return(target);
        }
 public static BL.CounterAction MapMvcToBusiness(MVC.CounterAction source)
 {
     if (source == null)
     {
         return(null);
     }
     BL.CounterAction target = BL.CounterAction.GetOrCreate(MapSupport.ActiveCtx, source.CounterActionId);
     if (target.Version != Guid.Empty && target.Version != source.CounterActionVersion)
     {
         throw new DataException("Concurrency check failed");
     }
     if (source.CounterActionIsDeleted)
     {
         target.Delete(MapSupport.ActiveCtx);
         return(null);
     }
     else
     {
         target.Version = source.CounterActionVersion;
         target.Text    = source.CounterActionText;
     }
     return(target);
 }