BTDB.IL.Caching.CachingILDynamicMethodWithThis.Create C# (CSharp) Method

Create() public method

public Create ( object @this ) : object
@this object
return object
        public object Create(object @this)
        {
            lock (_cachingILBuilder.Lock)
            {
                var item = new CacheItem(_name, _delegate, _thisType, _ilGen);
                item = (CacheItem)_cachingILBuilder.FindInCache(item);
                if (item.Object == null)
                {
                    var method = _cachingILBuilder.Wrapping.NewMethod(_name, _delegate, _thisType);
                    if (_expectedLength != -1) method.ExpectedLength(_expectedLength);
                    _ilGen.ReplayTo(method.Generator);
                    _ilGen.FreeTemps();
                    method.FinalizeCreation();
                    item.Object = method.Create;
                }
                return item.Object(@this);
            }
        }