예제 #1
0
파일: Link.cs 프로젝트: iancooper/Paramore
 public static Link Create(Task task, string hostName)
 {
     var link = new Link
     {
         Rel = "item",
         HRef = string.Format("http://{0}/{1}/{2}", hostName, "task", task.Id)
     };
     return link;
 }
예제 #2
0
파일: Link.cs 프로젝트: iancooper/Paramore
        public static Link Create(TaskListModel taskList, string hostName)
        {
            //we don't need to use taskList to build the self link
            var self = new Link
            {
                Rel = "self",
                HRef = string.Format("http://{0}/{1}", hostName, "tasks")
            };

            return self;
        }
예제 #3
0
 public TaskListModel(IEnumerable<Task> tasks, string hostName)
 {
     _self = Link.Create(this, hostName);
     _items = tasks.Select(task => TaskListItemModel.Create(task, hostName));
 }