public static ServerMailboxData ToMailboxData(Mailbox mailbox, ServerDomainAddressData address, List <ServerDomainAddressData> aliases) { var userDisplayName = ""; try { var user = CoreContext.UserManager.GetUsers(new Guid(mailbox.User)); userDisplayName = user.DisplayUserName(); } catch { // skip any errors } return(new ServerMailboxData { Id = mailbox.Id, UserId = mailbox.User, UserDisplayName = userDisplayName, Address = address, Name = mailbox.Name, Aliases = aliases }); }
public static ServerDomainAddressData ToServerDomainAddressData(ServerAddress address, string email) { var result = new ServerDomainAddressData { Id = address.Id, DomainId = address.DomainId, Email = email }; return(result); }
public static ServerDomainAddressData ToServerDomainAddressData(ServerAddress address, ServerDomainData domain) { var result = new ServerDomainAddressData { Id = address.Id, DomainId = address.DomainId, Email = string.Format("{0}@{1}", address.AddressName, domain.Name) }; return(result); }
public static ServerDomainGroupData ToServerDomainGroupData(int groupId, ServerDomainAddressData address, List <ServerDomainAddressData> addresses) { var group = new ServerDomainGroupData { Id = groupId, Address = address, Addresses = addresses }; return(group); }
public static ServerMailboxData ToMailboxData(Mailbox mailbox, ServerDomainAddressData address, List <ServerDomainAddressData> aliases) { return(new ServerMailboxData { Id = mailbox.Id, UserId = mailbox.User, Address = address, Name = mailbox.Name, Aliases = aliases }); }