Example #1
0
        /// <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.User UserWithUsername(DomainModels.TenantId tenantId, string username)
        {
            DomainModels.User user = this.Find(_ => _.TenantId_Id.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 RegistrationInvitation(TenantId tenantId, string invitationId, string description)
     : this(tenantId, invitationId, description, DateTime.MinValue, DateTime.MinValue)
 {
 }
 public UserDescriptor(TenantId tenantId, string username, string emailAddress)
 {
     this.EmailAddress = emailAddress;
     this.TenantId     = tenantId;
     this.Username     = username;
 }