refactor(Application): made IStringLocalizer<Resource>
This commit is contained in:
@@ -10,8 +10,8 @@ namespace DigitalData.UserManager.Application.Services
|
||||
{
|
||||
public class GroupService : BaseService<IGroupRepository, GroupCreateDto, GroupReadDto, Group>, IGroupService
|
||||
{
|
||||
private readonly IStringLocalizer<Resource> _localizer;
|
||||
public GroupService(IGroupRepository repository, IStringLocalizer<Resource> localizer, IMapper mapper) : base(repository, mapper)
|
||||
private readonly IStringLocalizer<Resource>? _localizer;
|
||||
public GroupService(IGroupRepository repository, IStringLocalizer<Resource>? localizer, IMapper mapper) : base(repository, mapper)
|
||||
{
|
||||
_localizer = localizer;
|
||||
}
|
||||
@@ -25,7 +25,7 @@ namespace DigitalData.UserManager.Application.Services
|
||||
group.AddedWho = user?.AddedWho ?? "UNAUTHORIZED";
|
||||
|
||||
if (await HasEntity(group.Id))
|
||||
return Result.Fail<int>().Message(_localizer[Key.GroupAlreadyExists.ToString()]);
|
||||
return Result.Fail<int>().Message(_localizer?[Key.GroupAlreadyExists].Value);
|
||||
|
||||
var createdGroup = await _repository.CreateAsync(group);
|
||||
if (createdGroup is null)
|
||||
|
||||
Reference in New Issue
Block a user