Skip to content

Instantly share code, notes, and snippets.

MJendza mjendza

Block or report user

Report or block mjendza

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View TaskFakeService
[InterceptLogger(1)]
public class TaskFakeService : ITaskService
{
public int GetById(int id)
{
return 1;
}
[InterceptExceptions(2)]
public IList<int> GetAll()
View InterceptLoggerAttribute
public class InterceptLoggerAttribute : InterceptAttribute
{
public InterceptLoggerAttribute(int order)
{
this.Order = order;
}
public override IInterceptor CreateInterceptor(IProxyRequest request)
{
View LoggerInterceptor
public class LoggerInterceptor : IInterceptor
{
public void Intercept(IInvocation invocation)
{
var logger = invocation.Request.Context.Kernel.Get<Logger>();
logger.Trace(string.Format("Start method {0} with {1}", invocation.Request.Method.Name, ArgumentsToString(invocation.Request.Arguments)));
invocation.Proceed();
logger.Trace(string.Format("End method {0} with {1}", invocation.Request.Method.Name, invocation.ReturnValue.ToString()));
}
View binding
kernel.Bind<ITaskService>().To<TaskService>().Intercept().With<ServiceInterceptor>();
View check_features.ps1
function Read-Onet{
param (
[string] $path
)
asnp *sharepoint*
$file = "C:\Program Files\Common Files\microsoft shared\Web Server Extensions\15\" + "TEMPLATE\" + $path+"\xml\onet.xml";
write-host $file
if (Test-Path $file) {
[xml]$onet = Get-Content $($file)
You can’t perform that action at this time.