internal static Map CreateMap(Map map)
        {
            MapBook mapbook = GetMapBook(map.MapTypeId);

            if (mapbook != null)
            {
                //if(map.MapBook.ApplicationId != null)
                try
                {
                    using (KhartaDataModel dbcontext = new KhartaDataModel())
                    {
                        map = dbcontext.Maps.Add(map);
                        dbcontext.SaveChanges();
                        return(map);
                    }
                }
                catch (Exception ex)
                {
                    string error = ex.InnerException.Message;
                    InternalApi.Utility.CoriaException csEx = new Utility.CoriaException(CSExceptionType.LoggableException, ex.InnerException.Message, null);
                    csEx.Log();

                    return(map);
                }
            }
            else
            {
                return(map);
            }
        }
 internal static CoriaMap CreateCoriaMap(CoriaMap coriaMap)
 {
     try
     {
         return(coriaMap.toCoriaMap(CreateMap(coriaMap.toMap(coriaMap))));
     }
     catch (Exception ex)
     {
         string error = ex.InnerException.Message;
         InternalApi.Utility.CoriaException csEx = new Utility.CoriaException(CSExceptionType.LoggableException, ex.InnerException.Message, null);
         csEx.Log();
         return(coriaMap);
     }
 }