示例#1
0
        public static CommunityEntity Map(this Community community)
        {
            var entity = new CommunityEntity {
                id = community.Id
            };

            community.MapTo(entity);
            return(entity);
        }
示例#2
0
        public static void MapTo(this Community community, CommunityEntity entity)
        {
            var flags = new CommunityFlags();

            flags = flags.SetFlag(CommunityFlags.HasMembers, community.HasMembers);
            flags = flags.SetFlag(CommunityFlags.HasOrganisationalUnits, community.HasOrganisations);
            flags = flags.SetFlag(CommunityFlags.OrganisationsCanSearchAllMembers, community.OrganisationsCanSearchAllMembers);
            flags = flags.SetFlag(CommunityFlags.OrganisationsAreBranded, community.OrganisationsAreBranded);

            entity.name        = community.Name;
            entity.shortName   = community.ShortName;
            entity.flags       = (byte)flags;
            entity.emailDomain = community.EmailDomain;
        }
示例#3
0
        public static Community Map(this CommunityEntity entity)
        {
            var flags = (CommunityFlags)entity.flags;

            return(new Community
            {
                Id = entity.id,
                Name = entity.name,
                ShortName = entity.shortName,
                HasMembers = flags.IsFlagSet(CommunityFlags.HasMembers),
                HasOrganisations = flags.IsFlagSet(CommunityFlags.HasOrganisationalUnits),
                OrganisationsCanSearchAllMembers = flags.IsFlagSet(CommunityFlags.OrganisationsCanSearchAllMembers),
                OrganisationsAreBranded = flags.IsFlagSet(CommunityFlags.OrganisationsAreBranded),
                EmailDomain = entity.emailDomain,
            });
        }
示例#4
0
 partial void DeleteCommunityEntity(CommunityEntity instance);
示例#5
0
 partial void UpdateCommunityEntity(CommunityEntity instance);
示例#6
0
 partial void InsertCommunityEntity(CommunityEntity instance);