public async Task <Car> Create(Car car)
        {
            using (GarageOrganizerDbContext context = _contextFactory.CreateDbContext())
            {
                await context.Cars.AddAsync(car);

                await context.SaveChangesAsync();

                return(car);
            }
        }
        public async Task <Client> Create(Client client)
        {
            using (GarageOrganizerDbContext context = _contextFactory.CreateDbContext())
            {
                await context.Clients.AddAsync(client);

                await context.SaveChangesAsync();

                return(client);
            }
        }
Example #3
0
        public async Task <Visit> Create(Visit visit)
        {
            using (GarageOrganizerDbContext context = _contextFactory.CreateDbContext())
            {
                await context.Visits.AddAsync(visit);

                await context.SaveChangesAsync();

                return(visit);
            }
        }