public override Task <SecurityLoginPayload> ReadSecurityLogin(SecurityLoginIdRequest request, ServerCallContext context)
        {
            SecurityLoginPoco poco = _logic.Get(Guid.Parse(request.Id));

            return(new Task <SecurityLoginPayload>(
                       () => new SecurityLoginPayload()
            {
                Id = poco.Id.ToString(),
                Login = poco.Login,
                Password = poco.Password,
                Created = Timestamp.FromDateTime((DateTime)poco.Created),
                PasswordUpdate = poco.PasswordUpdate is null ?
                                 null :
                                 Timestamp.FromDateTime((DateTime)poco.PasswordUpdate),
                AgreementAccepted = poco.AgreementAccepted is null ?
                                    null :
                                    Timestamp.FromDateTime((DateTime)poco.AgreementAccepted),
                IsLocked = poco.IsLocked,
                IsInactive = poco.IsInactive,
                EmailAddress = poco.EmailAddress,
                PhoneNumber = poco.PhoneNumber,
                FullName = poco.FullName,
                ForceChangePassword = poco.ForceChangePassword,
                PrefferredLanguage = poco.PrefferredLanguage
            }));
Ejemplo n.º 2
0
        public override Task <SecurityLogin> GetSecurityLogin(SecurityLoginIdRequest request, ServerCallContext context)
        {
            var poco = _logic.Get(Guid.Parse(request.Id));

            if (poco is null)
            {
                throw new ArgumentOutOfRangeException();
            }

            return(Task.FromResult(new SecurityLogin
            {
                Id = poco.Id.ToString(),
                Login = poco.Login,
                Password = poco.Password,
                Created = Timestamp.FromDateTime(poco.Created),
                PasswordUpdate = poco.PasswordUpdate is null ? null : Timestamp.FromDateTime((DateTime)poco.PasswordUpdate),
                AgreementAccepted = poco.AgreementAccepted is null ? null : Timestamp.FromDateTime((DateTime)poco.AgreementAccepted),
                IsLocked = poco.IsLocked,
                IsInactive = poco.IsInactive,
                EmailAddress = poco.EmailAddress,
                PhoneNumber = poco.PhoneNumber,
                FullName = poco.FullName,
                PrefferredLanguage = poco.PrefferredLanguage,
                ForceChangePassword = poco.ForceChangePassword
            }));
Ejemplo n.º 3
0
        public override Task <SecurityLoginPayload> ReadSecurityLogin(SecurityLoginIdRequest request, ServerCallContext context)
        {
            var poco = _logic.Get(Guid.Parse(request.Id));

            _ = poco ?? throw new ArgumentException("No Security Login Record with this Id Found ");

            return(new Task <SecurityLoginPayload>(() => new SecurityLoginPayload()
            {
                Id = poco.Id.ToString(),
                Login = poco.Login,
                EmailAddress = poco.EmailAddress,
                ForceChangePassword = poco.ForceChangePassword,
                Password = poco.Password,
                FullName = poco.FullName,
                PhoneNumber = poco.PhoneNumber,
                PrefferredLanguage = poco.PrefferredLanguage,
                IsInactive = poco.IsInactive,
                IsLocked = poco.IsLocked,
                AgreementAccepted = poco.AgreementAccepted != null ? Timestamp.FromDateTime((DateTime)poco.AgreementAccepted) : null,
                Created = poco.Created != null ? Timestamp.FromDateTime((DateTime)poco.Created) : null,
                PasswordUpdate = poco.Created != null ? Timestamp.FromDateTime((DateTime)poco.Created) : null,
            }));
        }
Ejemplo n.º 4
0
        public override Task <SecurityLoginReply> GetSecurityLogin(SecurityLoginIdRequest request, ServerCallContext context)
        {
            SecurityLoginPoco poco = logic.Get(Guid.Parse(request.Id));

            return(Task.FromResult(FromPoco(poco)));
        }