C#?????????AOP
???????????? ???????[ 2016/4/5 10:50:32 ] ??????????????????? .NET
????3??IL???
????????????????????????PostSharp??????????????????????????????????ù?????????
????Postsharp??2.0?汾???????????????AOP??????????????????????汾???????????PostSharp???????????????????????????????????????????????е??????????????AOP??????????????????????????????ò??????£?
??????1??????Postsharp????????????
??????2??????????AOP??????????PostSharp.dll ???dll?????á?
??????3????????????????
????[Serializable]
????public class TestAop : PostSharp.Aspects.OnMethodBoundaryAspect
????{
????//???????????????
????public override void OnException(MethodExecutionArgs args)
????{
????base.OnException(args);
????}
????//??з??????д????
????public override void OnEntry(MethodExecutionArgs args)
????{
????base.OnEntry(args);
????}
????//??з???????д????
????public override void OnExit(MethodExecutionArgs args)
????{
????base.OnExit(args);
????}
????}
????????????TestAop???????????????л?????????????[Serializable]????
??????4???????????????????á?
??????????????????????????????????е???????????????????
[TestAop]public class Impc_TM_PLANT : Ifc_TM_PLANT
{
///
/// ????????÷??????
///
private Ic_TM_PLANTService service { get; set; }
public IList Find()
{
DTO_TM_PLANT otest = null;
otest.NAME_C = "test";
//?????????OnException????
return service.FindAll(); ???????? }????}
???????????????????????????????
[TestAop]
public IList Find()
{
DTO_TM_PLANT otest = null;
otest.NAME_C = "test";
return service.FindAll();
}
????????ио??????????????????????????????????????????????????????????С???????????Postsharp???????????????????????????????????
????4??MVC?????Filter
public class AOPFilterAttribute : ActionFilterAttribute?? IExceptionFilter
{
public void OnException(ExceptionContext filterContext)
{
throw new System.NotImplementedException();
}
public override void OnActionExecuting(ActionExecutingContext filterContext)
{
base.OnActionExecuting(filterContext);
}
public override void OnActionExecuted(ActionExecutedContext filterContext)
{
base.OnActionExecuted(filterContext);
}
}
??????controller?????????????
????[AOPFilter]
????public JsonResult GetEditModel(string strType)
????{
????var lstRes = new List>();
????var lstResPage = new List();
????//.........todo
????return Json(new { lstDataAttr = lstRes?? PageAttr = lstResPage?? lstJsConnections = lstJsPlumbLines }?? JsonRequestBehavior.AllowGet);
????}
?????????????????GetEditModel(string strType)???????????????OnActionExecuting()??????GetEditModel(string strType)?????????OnActionExecuted()??????????????MVC???????????????????????????????ù???????????????
???????????????????????漰???????????????????SPASVOС??(021-61079698-8054)?????????????????????????
??????
???????C#?е?StringC# Socket???????????????????C#?????????????????????????C#???????C#????????????Log4net??????δ????C#?????????????C#?????????????????C#???????????????C#????????????????C#7 ?е?Tuple??????C#??TypeScript - GeneratorC# ?????????細??????????C#?е???н???C#??MySQL?????????μ??Ч?????д??C#????C++??dll???C#??VS2010????е??????
???·???
??????????????????
2023/3/23 14:23:39???д?ò??????????
2023/3/22 16:17:39????????????????????Щ??
2022/6/14 16:14:27??????????????????????????
2021/10/18 15:37:44???????????????
2021/9/17 15:19:29???·???????·
2021/9/14 15:42:25?????????????
2021/5/28 17:25:47??????APP??????????
2021/5/8 17:01:11????????
?????????App Bug???????????????????????Jmeter?????????QC??????APP????????????????app?????е????????jenkins+testng+ant+webdriver??????????????JMeter????HTTP???????Selenium 2.0 WebDriver ??????