-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPrismaConfig.cs
More file actions
40 lines (32 loc) · 1.09 KB
/
PrismaConfig.cs
File metadata and controls
40 lines (32 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
using TopModel.Core;
using TopModel.Generator.Core;
using TopModel.Utils;
namespace TopModel.Generator.Prisma;
/// <summary>
/// Paramètres pour la génération du Prisma.
/// </summary>
public class PrismaConfig : GeneratorConfigBase
{
/// <summary>
/// Chemin vers lequel sont créés les fichiers d'entités persistées créés, relatif au répertoire de génération.
/// </summary>
public string? EntityFilePath { get; set; }
public override string[] PropertiesWithTagVariableSupport => new[]
{
nameof(EntityFilePath)
};
protected override bool UseNamedEnums => false;
protected override string NullValue => "undefined";
protected override string GetEnumType(string className, string propName, bool isPrimaryKeyDef = false)
{
return $"{className.ToPascalCase()}{propName.ToPascalCase()}";
}
protected override bool IsEnumNameValid(string name)
{
return true;
}
protected override string ResolveTagVariables(string value, string tag)
{
return base.ResolveTagVariables(value, tag).Trim('/');
}
}