public static City ToCity(this ORMCity city) { return(new City() { Id = city.Id, Name = city.Name, Shops = null }); }
public bool Insert(City entity) { ORMCity city = entity.ToORMCity(); _client.Cypher .Merge("(c:City {city})") .WithParam("city", city) .ExecuteWithoutResults(); return(true); }
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); }