public object Create(IContext context) { Ninject.Parameters.IParameter identityParameter = context.Parameters.FirstOrDefault(p => p.Name.Equals(Kernel.USER_IDENTITY_PARAMETER)); Core.Identity.UserIdentity identity = (Core.Identity.UserIdentity)identityParameter.GetValue(context, null); return(identity); }
public object Create(IContext context) { Ninject.Parameters.IParameter domainIdentityParameter = (Ninject.Parameters.IParameter)context.Parameters.FirstOrDefault(p => p.Name.Equals(Kernel.DOMAIN_IDENTITY_PARAMETER)); Core.Identity.DomainIdentity domainIdentity = domainIdentityParameter.GetValue(context, null) as Core.Identity.DomainIdentity; return(new Backend.Infrastructure.Identity.ClientIdentity( domainIdentity != null ? domainIdentity.ClientIdentity.ClientId : string.Empty, domainIdentity != null ? domainIdentity.ClientIdentity.Name : string.Empty )); }