Open naji-makhoul opened 1 year ago
To automatically generate class properties based on the method parameters you need to
1) Create an empty target class (ClassDTO)
2) Set Unmapped sources to
Generate missing propertiesin the
Matching` tab of MappingGenerator setts
MippingGenerator should automatically add missing properties matching method parameters
thank you , but i want to generate new dto class and it will replace all the parameters in the method ... it's not same returned class
somthing like:
public async Task<List<students_QueryByDetailsResult>> SP_students_QueryByDetails(**ClassDTO data**)
{
var result = await _context.Procedures.students_QueryByDetailsAsync(data.PName, data.Fname, data.ParentPName, data.ParentFname, data.student_id, data.parent_id, data.Part, data.@class, data.StudyYear, data.IncludeLeftStudents, data.UD_index1,data. UD_value1, data.data.UD_index2, data.UD_value2);
return result;
}
There's no such feature in MappingGenerator at the moment. I know, that this kind of refactoring is provided by Resharper and it's called "Transform Parameters"
i have many functions in interface implemntaion, i want to create a webapi controler with one parameter as a dto class
there is a way to select multiple params from a function/method and convert it to new dto class ?
for example:
i want to copy all this params in function to new class like:
im using efCore powertools to generate function to all my stored procedures from the database, and my SPs have alot of paramaters ... i looking to use it like a dto class from POST API