public NoticesCollectionState Create(notice model) { var notice = new NoticesCollectionState { id = model.id, title = model.title, description = model.description, date = model.initialDate.Value, _Links = new LinkCollection() }; notice._Links.self = _links.Self(model.id); return(notice); }
public NoticeSingleState Create(notice model) { var notice = new NoticeSingleState { id = model.id, title = model.title, description = model.description, date = model.initialDate.Value, community = new CommunitiesCollectionFactory(new CommunityLinkFactory(_request)).Create(model.community), _links = new NoticeSingleState.Link() }; notice._links.self = _links.Self(model.id); notice._links.community = _links.Community(model.communityId.Value); return(notice); }