public UserSingleState Create(userInfo model)
        {
            var user = new UserSingleState
            {
                id           = model.id,
                name         = model.name,
                lastName     = model.lastName,
                email        = model.email,
                registerDate = model.registerDate.Value,
                local        = model.local,
                picture      = model.picture,
                gitHub       = model.github,
                facebook     = model.facebook,
                twitter      = model.twitter,
                biography    = model.biography,
                linkedin     = model.linkedin,

                _links = new UserSingleState.Link()
            };

            user._links.self             = _links.Self(model.id);
            user._links.subscribedEvents = _links.events(model.id);
            user._links.admin            = _links.CommunitiesWhereUserIsAdmin(model.id);
            user._links.member           = _links.CommunitiesWhereUserIsMember(model.id);
            return(user);
        }
Esempio n. 2
0
        public UsersCollectionState Create(userInfo model)
        {
            var user = new UsersCollectionState
            {
                id           = model.id,
                name         = model.name,
                lastName     = model.lastName,
                email        = model.email,
                registerDate = model.registerDate.Value,
                local        = model.local,
                picture      = model.picture,
                _Links       = new LinkCollection()
            };

            user._Links.self = _links.Self(model.id);
            return(user);
        }