コード例 #1
0
ファイル: Mappings.cs プロジェクト: formist/LinkMe
        public static CommunityEntity Map(this Community community)
        {
            var entity = new CommunityEntity {
                id = community.Id
            };

            community.MapTo(entity);
            return(entity);
        }
コード例 #2
0
ファイル: Mappings.cs プロジェクト: formist/LinkMe
        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
ファイル: Mappings.cs プロジェクト: formist/LinkMe
        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);