visual studio 2010 - Use of "@this" in Moles delegates -


when set property of moled type, looks require, first parameter, object of original moled type. noticed of examples in moles reference guide assign parameter @this , trying figure out why.

for instance, original class looks this:

public class productdao {     internal void insert(product product, string id)     {         ...     } } 

when go mole method, property expecting delegate first parameter type of moled object, in case, productdao object. in case, property expecting delegate of:

action<productdao, product, string> 

so have provide moled object first parameter of lambda expression? if so, what's difference in using regular variable name versus @this? @this mean/do?

mproductdao.allinstances.insertproductstring = (dao, product, id) => { }; 

versus

mproductdao.allinstances.insertproductstring = (@this, product, id) => { }; 


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -