Пример #1
0
 public static City ToCity(this ORMCity city)
 {
     return(new City()
     {
         Id = city.Id,
         Name = city.Name,
         Shops = null
     });
 }
Пример #2
0
        public bool Insert(City entity)
        {
            ORMCity city = entity.ToORMCity();

            _client.Cypher
            .Merge("(c:City {city})")
            .WithParam("city", city)
            .ExecuteWithoutResults();
            return(true);
        }
Пример #3
0
        private List <Shop> Construct(ORMCity city, IEnumerable <ORMShop> shops)
        {
            List <Shop> result = new List <Shop>(shops.Count());

            result.AddRange(shops.Select(shop => shop.ToShop()));
            City c = city.ToCity();

            c.Shops = result;
            for (int i = 0; i < result.Count; i++)
            {
                result[i].City = c;
            }
            return(result);
        }