コード例 #1
0
 public void Update(Friend friend)
 {
     var existingFriend = Get(friend.Id);
     existingFriend.Blog = friend.Blog;
     existingFriend.Avatar = friend.Avatar;
     existingFriend.Email = friend.Email;
     existingFriend.FullName = friend.FullName;
 }
コード例 #2
0
 public static Friend ToFriend(this Template template, int id = 0) {
     var friend = new Friend();
     friend.FullName = template.Data.GetDataByName("name").Value;
     friend.Email = template.Data.GetDataByName("email").Value;
     friend.Blog = new Uri(template.Data.GetDataByName("blog").Value);
     friend.Avatar = new Uri(template.Data.GetDataByName("avatar").Value);
     friend.Id = id;
     return friend;
 }
コード例 #3
0
 public int Add(Friend friend)
 {
     friend.Id = id++;
     friends.Add(friend);
     return friend.Id;
 }