Browse Source

Added ICurrentUser.GetId() extension method.

pull/272/head
Halil İbrahim Kalkan 9 years ago
parent
commit
1045e9dae4
  1. 2
      src/Volo.Abp.Security/Volo.Abp.Security.csproj.DotSettings
  2. 8
      src/Volo.Abp.Security/Volo/Abp/Users/CurrentUserExtensions.cs

2
src/Volo.Abp.Security/Volo.Abp.Security.csproj.DotSettings

@ -0,0 +1,2 @@
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
<s:String x:Key="/Default/CodeInspection/CSharpLanguageProject/LanguageLevel/@EntryValue">CSharp71</s:String></wpf:ResourceDictionary>

8
src/Volo.Abp.Security/Volo/Abp/Users/CurrentUserExtensions.cs

@ -1,4 +1,5 @@
using System; using System;
using System.Diagnostics;
using JetBrains.Annotations; using JetBrains.Annotations;
namespace Volo.Abp.Users namespace Volo.Abp.Users
@ -22,5 +23,12 @@ namespace Volo.Abp.Users
return value.To<T>(); return value.To<T>();
} }
public static Guid GetId(this ICurrentUser currentUser)
{
Debug.Assert(currentUser.Id != null, "currentUser.Id != null");
return currentUser.Id.Value;
}
} }
} }
Loading…
Cancel
Save