The goal of this project was to create a simple solution to enable validation of log file.
Project consists of two parts:
Blazor Serverapp written using MVVM pattern to keep markup and logic neatly separetedCore Librarycontainig logic and predefined rules for line validator
The assumed file structure consists of N rows (However the total size must be under 3MiB):
Event-Name; Event-Description; Start-Date-Time; End-Date-Time;
With constraints:
Event-Nameis not null or empty and under 32 characters longEvent-Descriptionis not null or empty and under 255 characters longStart-Datematches formatyyyy-MM-ddTHH:mm:sszzzEnd-Datematches formatyyyy-MM-ddTHH:mm:sszzz
To create your own validation rule make use of:
new CsvLineParserBuilder()
.WithSeparator(';')
.WithProperty(propName, errorMsg, params validationPredicates[])
.Build();
There is some settings made by default (Including max file size, allowed extensions of file and path to temporarily stored file). You may easily change them via modifying appsettings.json file.
Resources I made use of:
