Skip to content

Commit

Permalink
Added todo comments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Felix-CodingClimber committed Feb 10, 2024
1 parent 3d63a85 commit 41b54da
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/DotNetElements.Core/Core/Result/CrudResult.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,11 @@ public enum CrudError
ConcurrencyConflict,
}

// todo make abstract base class with TErrorCodeEnum as type parameter
// and where TErrorCodeEnum is enum constraint
// Inherited classes can provide custom error codes
// Error codes should be used to communicate errors back to client

public readonly partial struct CrudResult : IResult
{
public bool IsFail { get; }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,11 @@ public static IServiceCollection AddCrudService<TKey, TModel, TDetails, TEditMod
where TDetails : ModelDetails
where TEditModel : IMapFromModel<TEditModel, TModel>, ICreateNew<TEditModel>
{
// todo consider using the options pattern
// Action<CrudOptions<TModel>> configureOptions as parameter
// Call services.Configure(configureOptions);
// In CrudService inject a IOptions<CrudOptions<TModel>>

services.AddScoped<ICrudService<TKey, TModel, TDetails, TEditModel>>(provider => new CrudService<TKey, TModel, TDetails, TEditModel>(
provider.GetRequiredService<ISnackbar>(),
provider.GetRequiredService<HttpClient>(),
Expand Down

0 comments on commit 41b54da

Please sign in to comment.