The goal of this project was to create a simple solution to enable validation of log file.
Project consists of two parts:
Blazor Server
app written using MVVM pattern to keep markup and logic neatly separetedCore Library
containig 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-Name
is not null or empty and under 32 characters longEvent-Description
is not null or empty and under 255 characters longStart-Date
matches formatyyyy-MM-ddTHH:mm:sszzz
End-Date
matches 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: