Esempio n. 1
0
        public void GetAllLocations()
        {
            List <Location> locations = null;

            var client = _factory.GetHoTClient(db => {
                var location1 = new Location {
                    Name = "Location1"
                };

                db.Locations.Add(location1);
                db.Locations.Add(new Location {
                    Name = "Location2", Parent = location1
                });
                db.Locations.Add(new Location {
                    Name = "Location3"
                });
                db.SaveChanges();

                locations = db.Locations
                            .Include(l => l.Tags)
                            .Where(l => l.Id == location1.Id)
                            .ToList();
            });

            // var filter = new TagFilterModel
            // {
            //     Tags = new List<TagModel> {  }
            // };

            // using (var request = new HttpRequestMessage(HttpMethod.Post, "/api/house/locations"))
            // {
            //     var json = JsonConvert.SerializeObject();
            //     using (var stringContent = new StringContent(json, Encoding.UTF8, "application/json"))
            //     {
            //         request.Content = stringContent;

            //         using (var response = await client
            //             .SendAsync(request, HttpCompletionOption.ResponseHeadersRead)
            //             .ConfigureAwait(false))
            //         {
            //             response.EnsureSuccessStatusCode();
            //         }
            //     }
            // }
        }