-
Notifications
You must be signed in to change notification settings - Fork 50
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactoring database #251
Refactoring database #251
Conversation
Merge with remote branch aasx-server/main
Merge with remote branch
change email adress
change email change email
long first = smeIds.First(); | ||
long last = smeIds.Last(); | ||
List<SValueSet> valueList = null; | ||
using (AasContext db = new AasContext()) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could make this a bit saver and easier readable
using (AasContext db = new AasContext()) | |
using (AasContext db = new AasContext()) | |
{ | |
var watch = System.Diagnostics.Stopwatch.StartNew(); | |
var query = @" | |
SELECT * FROM SValueSets WHERE ParentSMEId >= {0} AND ParentSMEId <= {1} | |
UNION | |
SELECT * FROM IValueSets WHERE ParentSMEId >= {0} AND ParentSMEId <= {1} | |
UNION | |
SELECT * FROM DValueSets WHERE ParentSMEId >= {0} AND ParentSMEId <= {1} | |
"; | |
valueList = await db.SValueSets.FromSqlRaw(query, first, last) | |
.Where(v => smeIds.Contains(v.SMEId)) | |
.OrderBy(v => v.SMEId) | |
.ToListAsync(); | |
watch.Stop(); | |
Console.WriteLine($"Getting the value list took this time: {watch.ElapsedMilliseconds} ms"); | |
} | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CodeQL found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.
Description
Clean up the program code with database referenChange of terms to the official standards of the IDTA.ces and clean up of the database structure. Outsource the program code to a separate project ("AasxServerDB"). Changing the terms to the official standards of the IDTA.
Motivation and Context
Cleaning and simplifying the code that works with the database for easier further development of the database.
Type of change
Please delete options that are not relevant.
How Has This Been Tested?
These changes have been tested by running the application with 100.000 aas on a linux server and ensuring that all functionalities work as expected.
Screenshots (if appropriate):
Checklist: