update to .NET 6.0
This commit is contained in:
@@ -184,5 +184,34 @@ namespace CarParkValidationAPI.Repository
|
||||
Message = error
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
public async Task<ResultModel<Dictionary<int, LookupCodeDto>>> GetValidationPointDicAsync()
|
||||
{
|
||||
Dictionary<int, LookupCodeDto> resultList = new();
|
||||
|
||||
int statusCode = 0;
|
||||
string error = "";
|
||||
try
|
||||
{
|
||||
resultList = await _context.Validations.Where(x => x.Active == true)
|
||||
.Select(item => new LookupCodeDto { Id = item.ValidationPointID, Description = item.Description ?? "" })
|
||||
.ToDictionaryAsync(x => x.Id);
|
||||
|
||||
|
||||
statusCode = 1;
|
||||
}
|
||||
catch (Exception ex)
|
||||
{
|
||||
error = ex.ToString();
|
||||
statusCode = 0;
|
||||
throw ex;
|
||||
}
|
||||
return new ResultModel<Dictionary<int, LookupCodeDto>>()
|
||||
{
|
||||
Data = resultList,
|
||||
StatusCode = statusCode,
|
||||
Message = error
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user