update
This commit is contained in:
@@ -14,7 +14,7 @@ public class UpdateUserCommandHandler : IRequestHandler<UpdateUserCommand, Unit>
|
|||||||
public async Task<Unit> Handle(UpdateUserCommand request, CancellationToken cancellationToken)
|
public async Task<Unit> Handle(UpdateUserCommand request, CancellationToken cancellationToken)
|
||||||
{
|
{
|
||||||
if (!string.IsNullOrWhiteSpace(request.NationalCode) &&
|
if (!string.IsNullOrWhiteSpace(request.NationalCode) &&
|
||||||
_context.Users.Any(a => a.NationalCode == request.NationalCode))
|
_context.Users.Any(a => a.NationalCode == request.NationalCode && a.Id!= request.Id))
|
||||||
{
|
{
|
||||||
throw new Exception("کد ملی تکراری است");
|
throw new Exception("کد ملی تکراری است");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user