public DomainModels.User UserWithUsername(DomainModels.TenantId tenantId, string username) { DomainModels.User user = this.Find(_ => _.TenantId.Equals(tenantId.Id) && _.Username.Equals(username) ) .First(); return(user); //DomainModels.Enablement enablement = new DomainModels.Enablement(user.Enablement.Enabled, // user.Enablement.StartDate, // user.Enablement.EndDate); //DomainModels.FullName fullname = new DomainModels.FullName(user.PersonalInfo.FirstName, user.PersonalInfo.LastName); //DomainModels.EmailAddress email = new DomainModels.EmailAddress(user.PersonalInfo.Email); //DomainModels.PostalAddress postalAddress = new DomainModels.PostalAddress( // user.PostalAddress.StreetAddress, user.PostalAddress.City, user.PostalAddress.StateProvince, // user.PostalAddress.PostalCode, user.PostalAddress.CountryCode //); //DomainModels.Telephone primTel = new DomainModels.Telephone(user.PrimaryTelephone); //DomainModels.Telephone secTel = new DomainModels.Telephone(user.SecondaryTelephone); //DomainModels.ContactInformation contactInformation = new DomainModels.ContactInformation(email, postalAddress, // primTel, secTel); //DomainModels.Person person = new DomainModels.Person( // tenantId, // fullname, // contactInformation); //return new DomainModels.User( //tenantId, //user.Username, //user.Password, //enablement, //person); }
public DomainModels.Role RoleNamed(DomainModels.TenantId tenantId, string roleName) { DomainModels.Role role = Find(_ => _.TenantId.Equals(tenantId.Id) && _.Name.Equals(roleName)).First(); return(role); //new DomainModels.Role(tenantId, roleName, role.Description, role.SupportsNesting); }
/// <summary> /// Retrieves a <see cref="Group"/> from the repository, /// and implicitly persists any changes to the retrieved entity. /// </summary> /// <param name="tenantId"> /// The identifier of a <see cref="Tenant"/> to which /// a <see cref="Group"/> may belong, corresponding /// to its <see cref="Group.TenantId"/>. /// </param> /// <param name="groupName"> /// The name of a <see cref="Group"/>, matching /// the value of its <see cref="Group.Name"/>. /// </param> /// <returns> /// The instance of <see cref="Group"/> retrieved, /// or a null reference if no matching entity exists /// in the repository. /// </returns> DomainModels.Group IGroupRepository.GroupNamed(DomainModels.TenantId tenantId, string groupName) { DomainModels.Group group = Find(_ => _.TenantId.Equals(tenantId.Id) && _.Name.Equals(groupName)).First(); return(group); //new DomainModels.Group(tenantId, groupName, group.Description); }
public DomainModels.Tenant Get(DomainModels.TenantId tenantId) { var tenant = this.Find(Guid.Parse(tenantId.Id)); return(tenant); //return new DomainModels.Tenant( // new DomainModels.TenantId(tenant.Id.ToString()), // tenant.Name, // tenant.Description, // tenant.Active //); }
public RegistrationInvitation(TenantId tenantId, string invitationId, string description) : this(tenantId, invitationId, description, DateTime.MinValue, DateTime.MinValue) { }