private async Task GetEventAsync() { Event = await EventAppService.GetAsync(Guid.Parse(Id)); if (CurrentUser.IsAuthenticated) { IsRegistered = Event.Attendees.Any(a => a.UserId == CurrentUser.Id); } }
private async Task Delete() { if (!await MessageService.ConfirmAsync("This event will be deleted: " + Event.Title)) { return; } await EventAppService.DeleteAsync(Guid.Parse(Id)); NavigationManager.NavigateTo("/"); }
public EventAppService GetEventAppService() { Mocker = new AutoMocker(); Mocker.Use(new MapperConfiguration(ps => { ps.AddProfile(new EventMapper()); }).CreateMapper()); EventAppService = Mocker.CreateInstance <EventAppService>(); return(EventAppService); }
public void EventAppServiceStartup() { accountAppService = new AccountAppService(); eventAppService = new EventAppService(); host = accountAppService.Find("TestHost", "TestHost"); EventViewModel eventViewModel = new EventViewModel(); eventViewModel.HostId = host.Id; eventViewModel.Name = "TestEvent1"; eventViewModel.location = "Test"; eventViewModel.price = 4; eventViewModel.TotalAvailableTickets = 5; eventViewModel.category = 0; eventViewModel.date = DateTime.Now; Event1 = eventAppService.SaveNewEvent(eventViewModel); }
private async Task Create() { var id = await EventAppService.CreateAsync(Event); NavigationManager.NavigateTo("/events/" + id); }
private async Task UnRegister() { await EventAppService.UnRegisterAsync(Guid.Parse(Id)); await GetEventAsync(); }
public EventAppServiceTests() { _fixture = new EventAppServiceFixture(); _eventAppService = _fixture.GetEventAppService(); }