Skip to content

Commit

Permalink
Update form model name (dotnet#103)
Browse files Browse the repository at this point in the history
  • Loading branch information
guardrex authored Aug 9, 2023
1 parent b5fff4d commit 712da76
Show file tree
Hide file tree
Showing 30 changed files with 82 additions and 82 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

public class ExampleModel
public class Model
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample1> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new ExampleModel();
private Model model = new Model();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample7> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<CustomInputText @bind-Value="exampleModel.Name" />
<CustomInputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

<p>
CurrentValue: @exampleModel.Name
CurrentValue: @model.Name
</p>

@code {
private ExampleModel exampleModel = new ExampleModel();
private Model model = new Model();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

public class ExampleModel
public class Model
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample1> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new ExampleModel();
private Model model = new Model();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample7> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<CustomInputText @bind-Value="exampleModel.Name" />
<CustomInputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

<p>
CurrentValue: @exampleModel.Name
CurrentValue: @model.Name
</p>

@code {
private ExampleModel exampleModel = new ExampleModel();
private Model model = new Model();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

public class ExampleModel
public class Model
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample1> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample7> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<CustomInputText @bind-Value="exampleModel.Name" />
<CustomInputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

<p>
CurrentValue: @exampleModel.Name
CurrentValue: @model.Name
</p>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();
private EditContext editContext;

protected override void OnInitialized()
{
editContext = new(exampleModel);
editContext = new(model);
editContext.SetFieldCssClassProvider(new CustomFieldClassProvider());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

public class ExampleModel
public class Model
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample1> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample7> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<CustomInputText @bind-Value="exampleModel.Name" />
<CustomInputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

<p>
CurrentValue: @exampleModel.Name
CurrentValue: @model.Name
</p>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();
private EditContext editContext;

protected override void OnInitialized()
{
editContext = new(exampleModel);
editContext = new(model);
editContext.SetFieldCssClassProvider(new CustomFieldClassProvider());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

public class ExampleModel
public class Model
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample1> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample7> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<CustomInputText @bind-Value="exampleModel.Name" />
<CustomInputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

<p>
CurrentValue: @exampleModel.Name
CurrentValue: @model.Name
</p>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();
private EditContext? editContext;

protected override void OnInitialized()
{
editContext = new(exampleModel);
editContext = new(model);
editContext.SetFieldCssClassProvider(new CustomFieldClassProvider());
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
using System.ComponentModel.DataAnnotations;

public class ExampleModel
public class Model
{
[Required]
[StringLength(10, ErrorMessage = "Name is too long.")]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,17 +2,17 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample1> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<InputText @bind-Value="exampleModel.Name" />
<InputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,21 @@
@using Microsoft.Extensions.Logging
@inject ILogger<FormExample7> Logger

<EditForm Model="@exampleModel" OnValidSubmit="@HandleValidSubmit">
<EditForm Model="@model" OnValidSubmit="@HandleValidSubmit">
<DataAnnotationsValidator />
<ValidationSummary />

<CustomInputText @bind-Value="exampleModel.Name" />
<CustomInputText @bind-Value="model.Name" />

<button type="submit">Submit</button>
</EditForm>

<p>
CurrentValue: @exampleModel.Name
CurrentValue: @model.Name
</p>

@code {
private ExampleModel exampleModel = new();
private Model model = new();

private void HandleValidSubmit()
{
Expand Down
Loading

0 comments on commit 712da76

Please sign in to comment.