public ProcessResult CreateRoute(Route route, string[] places)
 {
     return CreateRoute(route, places.Select(place => Convert.ToInt32(place)).ToArray());
 }
 public ProcessResult CreateRoute(Route route, int[] places)
 {
     try
     {
         User user = DataManager.Users.Find(route.Author);
         if (user == null) return ProcessResults.InvalidAuthor;
         if (Translation.IsInValid(route.Translation))
             return ProcessResults.InvalidTranslations;
         if (places == null || places.Count() < 2)
             return ProcessResults.TooFewCheckPoints;
         Data.Translations.Add(route.Translation); //переводу приписвается id
         Data.SaveChanges();
         route.Name = route.Translation.Id;
         Data.Routes.Add(route);
         Data.SaveChanges();//route приписывается id
         var checkPoints = places.Select(place => new CheckPoint { PlaceId = place, RouteId = route.Id }).ToList();
         Data.CheckPoints.AddRange(checkPoints);
         Data.Bookmarks.Add(new Bookmark { RouteId = route.Id, UserId = user.Id });
         Data.SaveChanges();
         ProcessResult result = ProcessResults.RouteCreated;
         result.AffectedObjectId = route.Id;
         return result;
     }
     catch (Exception)
     {
         return ProcessResults.Error;
     }
 }
 public string CreateRoute(string token, Route route, int[] places, Culture culture = Culture.En)
 {
     if (!CheckToken(token)) return null;
     return ToJson(SProcessResult.Convert(DataManager.Routes.CreateRoute(route, places), culture));
 }