コード例 #1
0
ファイル: RepairService.cs プロジェクト: amirfahed/CarService
        public void Work()
        {
            var rand     = new Random();
            var carId    = Guid.NewGuid();
            var workerId = Guid.NewGuid();

            Cars.Create(new Car
            {
                Id     = carId,
                Name   = string.Format($"Car{rand.Next()}"),
                Number = string.Format($"{rand.Next()}")
            });

            Workers.Create(new Worker
            {
                Id        = workerId,
                Name      = string.Format($"Worker{rand.Next()}"),
                Position  = string.Format($"Position{rand.Next()}"),
                Telephone = string.Format($"8916{rand.Next()}{rand.Next()}{rand.Next()}{rand.Next()}{rand.Next()}{rand.Next()}{rand.Next()}")
            });

            var car    = Cars.Get(carId);
            var worker = Workers.Get(workerId);

            Documents.Create(new Document
            {
                CarId    = car.Id,
                WorkerId = worker.Id,
                Car      = car,
                Worker   = worker
            });
        }
コード例 #2
0
        static void Main(string[] args)
        {
            //Testing Fluent Api SQLite querry to JSON
            var documents = new Documents();

            documents.Create(new Document(1, DateTime.Now, DateTime.Now + TimeSpan.FromDays(10)
                                          , "Patobulinta eilute", true));

            documents.Create(new Document(1, DateTime.Now, DateTime.Now + TimeSpan.FromDays(10), "Next record", true));
            documents.ForProfile(1).Create(1);
            documents.ForProfile(1)
            .Is(DocumentStatus.Visible)
            .Not(DocumentStatus.Valid)
            .OrderDESC(DocumentColumns.AssociationId)
            .Read();
        }