public AccountsAccessLevelOfWebsite ToEntity(AccountsAccessLevelOfWebsite entity, AddWebsiteAccountDto dto) { entity.AccountId = dto.AccountId; entity.AccessLevels = dto.AccessLevels; return(entity); }
public bool Create() { if (!Save()) { return(false); } WebsiteId = _website.Id; if (_website.Accounts != null && _website.Accounts.Any()) { var accList = new AccountsAccessLevelOfWebsite[_website.Accounts.Count]; _website.Accounts.CopyTo(accList); foreach (var acc in accList) { var addWebsiteAccount = new AddWebsiteAccountDto() { AccessLevels = acc.AccessLevels, AccountId = acc.AccountId }; this.AddAccount(addWebsiteAccount); } } return(true); }