update to .NET 6.0

This commit is contained in:
Kham
2022-12-02 15:53:33 +11:00
parent b32d02b001
commit 93fa738d72
12 changed files with 235 additions and 23 deletions
+30 -1
View File
@@ -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
};
}
}
}