Skip to content

Instantly share code, notes, and snippets.

@gavilanch
Created January 16, 2020 14:41
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gavilanch/b419204b42e8fcbb9e8270f34f6edb22 to your computer and use it in GitHub Desktop.
Save gavilanch/b419204b42e8fcbb9e8270f34f6edb22 to your computer and use it in GitHub Desktop.
@page "/movies/create"
@inject NavigationManager navigationManager
<h3>Create Movie</h3>
<MovieForm Movie="Movie" OnValidSubmit="SaveMovie" NotSelectedGenres="NotSelectedGenres" />
@code {
private Movie Movie = new Movie();
private List<Genre> NotSelectedGenres = new List<Genre>()
{
new Genre(){Id = 1, Name = "Action"},
new Genre(){Id = 2, Name = "Comedy"},
new Genre(){Id = 3, Name = "Drama"}
};
private void SaveMovie()
{
Console.WriteLine("this works");
// Saving movie...
//navigationManager.NavigateTo("movie");
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment