public bool Add(Appointment appointment) { bool alreadyExists = AppointmentExistsWithDate(appointment); if (alreadyExists == false) { _repository.Create(appointment); //unitOfWork.Save(); } else { return(false); } return(true); }
public async Task <IActionResult> CreateSkill( [FromBody] SkillAddDto model, CancellationToken ct) { var entity = new SkillEntity { Id = Guid.NewGuid(), Name = model.Name, YearsOfExperience = model.YearsOfExperience, Level = model.Level }; await _repository.Create(entity, ct); return(Ok()); }
public async Task <ActionResult <ItemDTO> > Post(CreateItemDTO createItemDTO) { var item = new Items { Name = createItemDTO.Name, Description = createItemDTO.Description, Price = createItemDTO.Price, CreatedDate = DateTimeOffset.UtcNow }; await _itemsRepository.Create(item); await _publishEndpoint.Publish(new CatalogItemCreated(item.Id, item.Name, item.Description)); return(CreatedAtAction(nameof(GetById), new { id = item.Id }, item)); }
public async Task Create(UserDto user) { switch (_useDb) { case ConnectDb.MariaDb: await _userRepository.Create(user); break; case ConnectDb.Mongo: await _mongoUserRepository.Create(user); break; } if (_redisUserRepository != null) { await _redisUserRepository.Create(user); } }
public NotificationEntity Create(NotificationEntity entity) { return(_mongoRepository.Create(entity)); }
public ActionResult <Order> Create([FromBody] Order order) { _orderRepository.Create(order); return(CreatedAtRoute("GetOrder", new { id = order.Id.ToString() }, order)); }
public ActionResult <Order> Create([FromBody] Category category) { _categoryRepository.Create(category); return(CreatedAtRoute("GetCategory", new { id = category.Id.ToString() }, category)); }
public TaskGroup CreateValue(TaskGroup item) { return(_repository.Create(item)); }
public ActionResult <Product> Create([FromBody] Product product) { _productRepository.Create(product); return(CreatedAtRoute("GetProduct", new { id = product.Id.ToString() }, product)); }
public Task CreateValue(Task item) { return(_repository.Create(item)); }
public ProfileEntity?Create(ProfileEntity entity) { return(_mongoRepository.Create(entity)); }
public ActionResult <Klient> Create(Klient klient) { _klienciRepository.Create(klient); return(CreatedAtRoute("GetKlient", new { id = klient.Id }, klient)); }