Beispiel #1
0
        static void Main(string[] args)
        {
            ctx = new MongoCRUD("Hotel");

            var record = GetById("Invoices", "d6de95e9-23ac-471c-8509-700322cf7766");

            record.Booking.Created = DateTime.Now;
            ctx.UpsertRecords("Invoices", record.Id, record);
            ctx.DeleteRecord <InvoiceModel>("Invoices", record.Id);

            Console.ReadLine();
        }
Beispiel #2
0
        static void InsertInvoice(MongoCRUD ctx)
        {
            var invoice = new InvoiceModel
            {
                IsCanceled = false,
                Total      = 4800,
                Booking    = new BookingModel
                {
                    IsCanceled = false,
                    FirstName  = "Kaj",
                    LastName   = "Svensson",
                    Email      = "*****@*****.**",
                    //BookingNumber = ""
                }
            };

            ctx.InsertRecord("Invoices", invoice);
        }