public override Task <SecurityLogins> GetSecurityLogins(Empty request, ServerCallContext context) { List <SecurityLoginPoco> pocos = _logic.GetAll(); SecurityLogins seclogs = new SecurityLogins(); foreach (var poco in pocos) { SecurityLoginReply reply = FromPoco(poco); seclogs.SecLogs.Add(reply); } return(Task.FromResult(seclogs)); }
private SecurityLoginPoco ToPoco(SecurityLoginReply reply) { return(new SecurityLoginPoco { Id = Guid.Parse(reply.Id), EmailAddress = reply.EmailAddress, FullName = reply.FullName, Login = reply.Login, ForceChangePassword = reply.ForceChangePassword, Password = reply.Password, IsInactive = reply.IsInactive, IsLocked = reply.IsLocked, PhoneNumber = reply.PhoneNumber, PrefferredLanguage = reply.PrefferredLanguage, Created = reply.Created.ToDateTime(), AgreementAccepted = reply.AgreementAccepted == null ? null : (DateTime?)reply.AgreementAccepted.ToDateTime(), PasswordUpdate = reply.PasswordUpdate == null ? null : (DateTime?)reply.PasswordUpdate.ToDateTime(), TimeStamp = reply.TimeStamp.ToByteArray() }); }