Пример #1
0
        public static async Task <bool> Create(Guid token, string departmentCode, Models.Cars.CarInService carInService)
        {
            AuthenticationLogic.CheckTokenInfo(token);
            using (var db = new DataAccess.CaraxEntitiy())
            {
                var find = db.CarInServices.First(q => q.CarId == carInService.CarId && q.CarServiceId == carInService.CarServiceId);
                await db.CarInServices.AddAsync(carInService);

                return(await db.SaveChangesAsync() > 0);
            }
        }
Пример #2
0
        public async Task <IActionResult> Create([FromBody] Models.Cars.CarInService carInService)
        {
            var isSuccess = await CarInServiceLogic.Create(GetToken(), GetDepartmentCode(), carInService);

            return(Ok(isSuccess));
        }