Esempio n. 1
0
        public async Task DataService_Inserts_Course()
        {
            var course = new Course()
            {
                Name  = "Hog Neck Executive",
                Holes = new List <Hole>()
            };

            course.Id = Guid.NewGuid().ToString();
            var hole = new Hole();

            hole.Number   = 1;
            hole.TeeBoxes = new Dictionary <string, Location>();
            hole.TeeBoxes.Add("Blue", new Location()
            {
                Latitude = 50, Longitude = 50, Accuracy = 1
            });
            hole.Pin = new Location()
            {
                Latitude = 51, Longitude = 51, Accuracy = 1
            };
            course.Holes.Add(hole);

            await DataService.AddCourse(course);
        }
Esempio n. 2
0
 public void Post([FromBody] Course course)
 {
     DataService.AddCourse(course);
 }