(body: string)
| 209 | |
| 210 | // Extract navigation properties / relationships |
| 211 | function extractCSharpRelations(body: string): string[] { |
| 212 | const relations: string[] = []; |
| 213 | // public virtual ICollection<Post> Posts { get; set; } |
| 214 | // public virtual User User { get; set; } |
| 215 | const navPattern = |
| 216 | /public\s+virtual\s+(I?(?:Collection|List)<\s*(\w+)\s*>|(\w+))\s+(\w+)\s*\{/g; |
| 217 | let m: RegExpExecArray | null; |
| 218 | while ((m = navPattern.exec(body)) !== null) { |
| 219 | const collectionType = m[2]; |
| 220 | const singleType = m[3]; |
| 221 | const propName = m[4]; |
| 222 | if (collectionType) { |
| 223 | relations.push(`${propName}: ${collectionType}[]`); |
| 224 | } else if (singleType && singleType !== "string" && singleType !== "int" && singleType !== "bool") { |
| 225 | relations.push(`${propName}: ${singleType}`); |
| 226 | } |
| 227 | } |
| 228 | return relations; |
| 229 | } |
| 230 | |
| 231 | // ─── C# lib exports ──────────────────────────────────────────────────────── |
| 232 |
no outgoing calls
no test coverage detected