public async Task <IActionResult> OnPostAsync() { if (!ModelState.IsValid) { return(Page()); } Movie.id = Guid.NewGuid().ToString(); Movie.Distributor = new Distributor { Name = "Out of this World Movies", Address = new Address { State = "CA", City = "Los Angelos", Zip = 90001 } }; await cosmosDbRepository.AddItemAsync(Movie); return(RedirectToPage(routeName)); }