Ejemplo n.º 1
0
        protected async Task SetCurrentUser()
        {
            var authState = await AuthenticationStateProvider.GetAuthenticationStateAsync();

            var authUser = authState.User;

            CurrentUser = await Http.GetPersonByUserName(authUser.Identity.Name);
        }
        public void FromClientPersonToDTO()
        {
            var clientPerson = new ClientBasePerson();

            var dto = (BasePersonDTO)clientPerson;

            Assert.IsType <BasePersonDTO>(dto);
        }
Ejemplo n.º 3
0
        protected override async Task OnInitializedAsync()
        {
            await SetCurrentUser();

            if (!(string.IsNullOrEmpty(Id) && Id == CurrentUser.Id))
            {
                PersonDetails = await Http.GetPersonById(Id);
            }
            else
            {
                PersonDetails = await Http.GetPersonById(CurrentUser.Id);
            }
        }
        protected async Task CallSaveChanges(ClientBasePerson person)
        {
            await Http.UpdatePerson(person);

            NavManager.NavigateTo($"/Person/Detail/{person.Id}");
        }
 protected override async Task OnInitializedAsync()
 {
     person = await Http.GetPersonById(Id);
 }