Commit 6e3bf886 authored by Benedikt Heinrichs's avatar Benedikt Heinrichs

Update: Simplify Event firing (coscine/issues#179)

parent bd1ed418
......@@ -7,7 +7,6 @@ using Coscine.ApiCommons;
using Coscine.ApiCommons.Exceptions;
using Coscine.ApiCommons.Factories;
using Microsoft.AspNetCore.Mvc;
using Microsoft.SharePoint;
using System;
using System.Collections.Generic;
using System.Linq;
......@@ -91,24 +90,10 @@ namespace Coscine.Api.Project.Controllers
private void FireEvents(Action<IProjectAction, ProjectEventArgs> eventAction)
{
var sharePointSite = Request.Headers["Referer"];
SPUserToken systemAccount = SPUserToken.SystemAccount;
using (SPSite site = new SPSite(sharePointSite, systemAccount))
ProjectEventArgs projectEventArgs = new ProjectEventArgs(Program.Configuration, new object[0]);
foreach (var projectAction in projectActions)
{
using (SPWeb web = site.OpenWeb())
{
SPContext context = SPContext.GetContext(web);
object[] args = new object[]
{
context
};
ProjectEventArgs projectEventArgs = new ProjectEventArgs(Program.Configuration, args);
foreach (var projectAction in projectActions)
{
eventAction(projectAction, projectEventArgs);
}
}
eventAction(projectAction, projectEventArgs);
}
}
}
......
......@@ -353,7 +353,6 @@
<Reference Include="Microsoft.Net.Http.Headers, Version=2.2.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Net.Http.Headers.2.2.0\lib\netstandard2.0\Microsoft.Net.Http.Headers.dll</HintPath>
</Reference>
<Reference Include="Microsoft.SharePoint, Version=16.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c, processorArchitecture=MSIL" />
<Reference Include="Microsoft.Win32.Registry, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.Win32.Registry.4.5.0\lib\net461\Microsoft.Win32.Registry.dll</HintPath>
</Reference>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment