コード例 #1
0
ファイル: IdentityEx.cs プロジェクト: Darayas/Darayas.Map
        public static async Task <tblUsers> GetUserDetailsAsync(this ClaimsPrincipal User)
        {
            var repUser = new SqlRepository <tblUsers>();

            try
            {
                var qUser = await repUser.Get()
                            .Where(a => a.UserName == User.Identity.Name)
                            .Select(a => new tblUsers
                {
                    Email    = a.Email,
                    Family   = a.Family,
                    Id       = a.Id,
                    Name     = a.Name,
                    UserName = a.UserName
                })
                            .SingleOrDefaultAsync();

                return(qUser);
            }
            catch (Exception ex)
            {
                throw ex;
            }
            finally
            {
                repUser.Dispose();
            }
        }
コード例 #2
0
 internal virtual void Dispose()
 {
     Repository.Dispose();
 }