public async void CreateLecturer(CreateLecturerDto createLecturerDto)
        {
            var connectionString = _configuration.GetConnectionString("CosmosDB");
            var client           = new CosmosClientBuilder(connectionString)
                                   .WithSerializerOptions(new CosmosSerializationOptions
            {
                PropertyNamingPolicy = CosmosPropertyNamingPolicy.CamelCase
            })
                                   .Build();

            var createLecturerContainer = client.GetContainer("TestDatabase", "Lecturer");

            var lecturer = new CreateLecturerDto
            {
                Name = createLecturerDto.Name
            };

            await createLecturerContainer.CreateItemAsync(lecturer);
        }
예제 #2
0
 public void CreateLecturer(CreateLecturerDto createLecturerDto)
 {
     _lecturerRepository.CreateLecturer(createLecturerDto);
 }