public async Task CreateAsync_Should_InvokeGenericRepositoryCreate_Once() { Entity <int> outParam; await _genericService.CreateAsync(_testEntity); _mockGenericRepository.Verify(x => x.TryGetOne(_testEntity.Id, out outParam, It.IsAny <bool>()), Times.Once); _mockGenericRepository.Verify(x => x.CreateAsync(_testEntity), Times.Once); }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); var btnCreate = turple.Item1; var number = turple.Item2; var time = turple.Item3; var planes = turple.Item4; var crews = turple.Item5; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var plane = new DepartureDTO() { FlightNumber = number.Text, DepartureTime = (new DateTime(2018, 2, 2) + time.Time).ToString(), PlaneId = ((PlaneDTO)planes.SelectedItem).Id, CrewId = ((CrewDTO)crews.SelectedItem).Id }; try { await service.CreateAsync(plane); } catch (Exception) { } departuresList.Add(plane); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); var btnCreate = turple.Item1; var firstname = turple.Item2; var lastname = turple.Item3; var birthday = turple.Item4; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var pilot = new StewardessDTO() { FirstName = firstname.Text, LastName = lastname.Text, DateOfBirth = birthday.Date.Value.Date.ToString() }; try { await service.CreateAsync(pilot); } catch (Exception) { } stewardessesList.Add(pilot); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); var btnCreate = turple.Item1; var name = turple.Item2; var timespan = turple.Item3; var createdat = turple.Item4; var types = turple.Item5; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var plane = new PlaneDTO() { Name = name.Text, LifeTime = timespan.Text, Created = createdat.Date.Value.Date.ToString(), TypePlaneId = ((PlaneTypeDTO)types.SelectedItem).Id }; try { await service.CreateAsync(plane); } catch (Exception) { } planesList.Add(plane); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); Button btnCreate = turple.Item1; ComboBox Pilot = turple.Item2; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var crew = new CrewDTO() { PilotId = ((PilotDTO)Pilot.SelectedItem).Id, StewardressIds = selectedStews }; try { await service.CreateAsync(crew); } catch (Exception) { } crewsList.Add(crew); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); var btnCreate = turple.Item1; var model = turple.Item2; var places = turple.Item3; var carrying = turple.Item4; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var planetype = new PlaneTypeDTO() { Model = model.Text, Places = int.Parse(places.Text), Carrying = double.Parse(carrying.Text) }; try { await service.CreateAsync(planetype); } catch (Exception) { } planetypesList.Add(planetype); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); Button btnCreate = turple.Item1; TextBox number = turple.Item2; TextBox StartPoint = turple.Item3; TextBox FinishPoint = turple.Item4; TimePicker StarTime = turple.Item5; TimePicker FinishTime = turple.Item6; ComboBox SelectedTickets = turple.Item7; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var flight = new FlightDTO() { Number = number.Text, StartPoint = StartPoint.Text, FinishPoint = FinishPoint.Text, StartTime = (new DateTime(2018, 2, 2) + StarTime.Time).ToString(), FinishTime = (new DateTime(2018, 2, 2) + FinishTime.Time).ToString(), TicketIds = selectedTickets }; try { await service.CreateAsync(flight); } catch (Exception) { } flightsList.Add(flight); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); var btnCreate = turple.Item1; var firstname = turple.Item2; var lastname = turple.Item3; var expirience = turple.Item4; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var pilot = new PilotDTO() { FirstName = firstname.Text, LastName = lastname.Text, Experience = int.Parse(expirience.Text) }; try { await service.CreateAsync(pilot); } catch (Exception) { } pilotsList.Add(pilot); UpdateList(); SingleItem.Children.Clear(); }; }
private void Create_Click(object sender, RoutedEventArgs e) { var turple = RenderCreate(); var btnCreate = turple.Item1; var number = turple.Item2; var price = turple.Item3; btnCreate.Click += async(object sen, RoutedEventArgs evArgs) => { var ticketCreating = new TicketDTO() { FlightNumber = number.Text, Price = double.Parse(price.Text) }; try { await service.CreateAsync(ticketCreating); } catch (Exception) { } ticketList.Add(ticketCreating); UpdateList(); SingleItem.Children.Clear(); }; }
public virtual async Task Create([FromBody] TModelRequest model) { await _service.CreateAsync(model); }