I'm making a changelog web application that is linked to GitLab, that gets data from a database table that is updated whenever there's a push on GitLab.
To make a push we add a custom ID to the message area followed by the message that could be whatever. This custom ID must be; M####/C#####/Merge/Revert. Where # represents a numeric value (0-9).
The application has to recognise every push's ID so that it can be later used for filtering etc.
Previously I've used this code to select only the M#### and C#####, but once 'Merge' was used as the ID it would also show up.
var query = from c in db.Clgcom
where c.Prjid == 7
&& (c.Modid.StartsWith("C")
|| c.Modid.StartsWith("M"))
select c.Modid;
result:
M1234, M2345, C12345, M0000, C75843, Merge
Using .StartsWith("M####")
doesn't work, and I've got no idea how to solve this other than using 10 different cases;
where c.Modid.StartsWith("M0")
|| c.Modid.StartsWith("M1")
|| c.Modid.StartsWith("M2")
|| c.Modid.StartsWith("M3")
// etc.
Is there a better way to solve my problem?
edit: I'm using Entity Framework so regex could cause problems.