How to create attribute based logger class which would read the all the input paramters of method and response object of method and both log into database.
so,
[LogReqResponse(request:fieldname,LogObject:Employee,Message:"")]
public int GetData(string id,Employee e)
{
...
return resultId;
}
so, LogReqResponse's class would have - ID, Employee object where, I do related processing and log into database and , response of method also log into database.
How can I achieve this.
there is no action filter kind of thing, its just C# class library 4.6.2 framework. ///////////////// this is different that mentioned question.
Updated code above, method should process as per specified file for request,logobject and message and log into database after processing.
How to create such logger class that read method's paramter as well give response of method also to log. its all in attribute class.