Skip to content

Commit

Permalink
Rename ClientModel
Browse files Browse the repository at this point in the history
The new System.ClientModel library is a dependency that we get from EF, and its namespace name conflicts with our existing class name. There's no good way to resolve the ambiguity, short of just renaming the model. We need to do the same in the templates. (DuendeSoftware/IdentityServer.Templates#56)
  • Loading branch information
josephdecock committed Sep 19, 2024
1 parent 043bd4c commit 11d7756
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions hosts/EntityFramework/Pages/Admin/Clients/ClientRepository.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ public class CreateClientModel : ClientSummaryModel
public string Secret { get; set; } = default!;
}

public class ClientModel : CreateClientModel, IValidatableObject
public class EditClientModel : CreateClientModel, IValidatableObject
{
[Required]
public string AllowedScopes { get; set; } = default!;
Expand Down Expand Up @@ -91,7 +91,7 @@ public async Task<IEnumerable<ClientSummaryModel>> GetAllAsync(string? filter =
return await result.ToArrayAsync();
}

public async Task<ClientModel?> GetByIdAsync(string id)
public async Task<EditClientModel?> GetByIdAsync(string id)
{
var client = await _context.Clients
.Include(x => x.AllowedGrantTypes)
Expand All @@ -103,7 +103,7 @@ public async Task<IEnumerable<ClientSummaryModel>> GetAllAsync(string? filter =

if (client == null) return null;

return new ClientModel
return new EditClientModel
{
ClientId = client.ClientId,
Name = client.ClientName,
Expand Down Expand Up @@ -146,7 +146,7 @@ public async Task CreateAsync(CreateClientModel model)
await _context.SaveChangesAsync();
}

public async Task UpdateAsync(ClientModel model)
public async Task UpdateAsync(EditClientModel model)
{
ArgumentNullException.ThrowIfNull(model);
var client = await _context.Clients
Expand Down
2 changes: 1 addition & 1 deletion hosts/EntityFramework/Pages/Admin/Clients/Edit.cshtml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ public EditModel(ClientRepository repository)
}

[BindProperty]
public ClientModel InputModel { get; set; } = default!;
public EditClientModel InputModel { get; set; } = default!;
[BindProperty]
public string? Button { get; set; }

Expand Down

0 comments on commit 11d7756

Please sign in to comment.