public SingleValueObjectAttribute( Type underlyingType, string fullName, SvoFeatures features = SvoFeatures.Default) { UnderlyingType = underlyingType ?? typeof(string); FullName = fullName ?? UnderlyingType.Name; Features = features; }
private static async Task Generate(string name, Type underlying, string fulleName, string ns, SvoFeatures features, string path, string formatExceptionMessage) { var arguments = new SvoArguments { Name = name, Underlying = underlying, FullName = fulleName, Namespace = ns, Features = features, FormatExceptionMessage = formatExceptionMessage ?? $"QowaivMessages.FormatException{name}" }; var generator = new SvoCodeGenerator(arguments); var generated = await generator.GenerateAsync(); var location = new FileInfo(path); if (!location.Directory.Exists) { location.Directory.Create(); } using var writer = new StreamWriter(location.FullName, false, Encoding.UTF8); generated.WriteTo(writer); }
public async Task Qowaiv_DataClient(string name, Type underlying, string fulleName, string ns, SvoFeatures features, string formatExceptionMessage = null) { var path = $@"C:\Code\qowaiv\src\Qowaiv.Data.SqlClient\Generated\{name}.generated.cs"; await Generate(name, underlying, fulleName, ns, features, path, formatExceptionMessage); }
public async Task Qowaiv(string name, Type underlying, string fulleName, string ns, SvoFeatures features, string formatExceptionMessage = null) { var sub = ns.Replace("Qowaiv", "").Replace(".", @"\"); var path = $@"C:\Code\qowaiv\src\Qowaiv\Generated\{sub}\{name}.generated.cs".Replace(@"\\", @"\"); await Generate(name, underlying, fulleName, ns, features, path, formatExceptionMessage); }
public bool LacksFeature(SvoFeatures feature) => !HasFeature(feature);
public bool HasFeature(SvoFeatures feature) => Features.HasFlag(feature);