示例#1
0
        IMemberSerializer Content(IMember profile, IMemberAccess access)
        {
            var identity  = new Identity <object>(profile);
            var composite = IsMember(profile)
                                                ? (IWriter <object>) new MemberPropertyWriter(identity)
                                                : identity;
            var start  = composite.Adapt();
            var body   = _content.Get(profile);
            var writer = new MemberWriter(access, new Enclosure(start, body));
            var result = new MemberSerializer(profile, access, body, writer);

            return(result);
        }
示例#2
0
        IMemberSerializer Content(IMember profile, IMemberAccess access)
        {
            var identity  = new Identity <object>(profile);
            var composite = CollectionItemTypeLocator.Default.Get(profile.MemberType)
                            ?.Name == profile.Name
                                                ? (IWriter <object>) new MemberPropertyWriter(identity)
                                                : identity;
            var start  = composite.Adapt();
            var body   = _content.Get(profile);
            var writer = new MemberWriter(access, new Enclosure(start, body));
            var result = new MemberSerializer(profile, access, body, writer);

            return(result);
        }