public void Populate()
        {
            ////var svc = new KnockKnockMongo();
            //var db = svc.Database<PotatoKnock>();
            //db.DeleteMany(Builders<PotatoKnock>.Filter.Empty);
            
            var knock = new KnockDto {
                FeedId = Guid.NewGuid(),
                Id = Guid.NewGuid(),
                Location = new LocationDto
                {
                    Latitude = 45,
                    Longitude = 60
                },
                Message = "Turn me into a french fry?"
            };
            using (var svc = new JsonServiceClient("http://localhost:40300/"))
            {
                var knockstr = knock.SerializeToString();
                svc.Post(new KnockPost { Knock = knock });
            }
            //svc.Any(new KnockPost {Knock = knock});

            Console.WriteLine(knock.Id);
        }
Пример #2
0
        public PotatoKnock(KnockDto other)
        {
            this.Id = other.Id;
            FeedId = other.FeedId;
            Content = other.Content;
            Message = other.Message;
            Location = other.Location.ToGeoJsonPoint();

        }
Пример #3
0
 public Potato(KnockDto other)
 {  
     Id = other.Id;
     FeedId = other.FeedId;
     Content = other.Content;
     Message = other.Message;
     Location = other.Location;
     PotatoLoc = new GeoJsonPoint<GeoJson2DGeographicCoordinates>(new GeoJson2DGeographicCoordinates(other.Location.Longitude, other.Location.Latitude));
 }
Пример #4
0
 public void Populate()
 {
     
     var knock = new KnockDto()
     {
         FeedId = "potato",
         Id = new Random().Next(0, 100000),
         Location = new LocationDto
         {
             Latitude = 45,
             Longitude = 60
         },
         Message = "Turn me into a french fry?"
     };
     //using (var svc = new JsonServiceClient("http://localhost:40300/"))
     //{
     //    svc.Post(new KnockPostV1() {KnockDto = knock});
     //}
     var svc = new KnockKnockMongo();
     svc.Any(new KnockPostV1 {Knock = knock});
     
     Console.WriteLine(knock.Id);
 }