I have the following inside my event receiver which get fired when an item is updated:-
public override void ItemUpdated(SPItemEventProperties properties)
{
base.ItemUpdated(properties);
using (SPSite site = new SPSite(properties.SiteId))
{
string currenweburl = properties.RelativeWebUrl;
using (SPWeb spCurrentSite = site.OpenWeb(currenweburl))
{
var currentuserid = properties.CurrentUserId;
site.RootWeb.SiteGroups.Add(curItemSiteName, site.RootWeb.SiteUsers[currentuserid], site.RootWeb.SiteUsers[currentuserid], "Your Group Description");
currently i was trying to add the user who updated an item to be the new Group owner and being added as a member. but the problem i am getting is that thecurrentuserid will be equal to 1, and the result is that the member which get added is not ME (the user who updated the item!!). so can anyone adivce on this please? why theproperties.CurrentUserId does not return the current user id ?
Thanks