private async Task <SourceUnit> GenerateCommand(ProcedureDescriptor proc, ObjectType obj) { DataClassBuilder builder = new DataClassBuilder() .InNamespace(obj.Namespace) .WithName(obj.Name); foreach (var p in obj.Properties) { builder.WithProperty(p.PropertyType.SrcName(), p.Name); } return(new SourceUnit(obj.Namespace, obj.Name, builder.GenerateCode())); }
private static SourceUnit GenerateResponseType(string responseTypeName, Type responseType) { DataClassBuilder builder = new DataClassBuilder() .WithName(responseTypeName) .InNamespace(responseType.Namespace + ".WebApi"); foreach (var p in responseType.GetProperties()) { builder.WithProperty(p.PropertyType, p.Name); } var src = builder.GenerateCode(); return(new SourceUnit(builder.Namespace, builder.Name, src)); }
private static SourceUnit GenerateRequestType(string requestTypeName, Type commandType, Type exPropType, string exPropName) { DataClassBuilder builder = new DataClassBuilder() .WithName(requestTypeName) .InNamespace(commandType.Namespace + ".WebApi"); foreach (var p in commandType.GetProperties().Where(x => x.Name != exPropName)) { builder.WithProperty(p.PropertyType, p.Name); } var src = builder.GenerateCode(); return(new SourceUnit(builder.Namespace, builder.Name, src)); }