public static string GetChannelOwner(int userId) { using (RentItServiceClient proxy = new RentItServiceClient()) { return proxy.GetUser(userId).Username; } }
public static GuiComment ConvertComment(Comment c) { GuiComment comment = new GuiComment() { UserId = c.UserId, Content = c.Content, Date = c.PostTime, ChannelId = c.ChannelId }; using (RentItServiceClient proxy = new RentItServiceClient()) { comment.UserName = proxy.GetUser(comment.UserId).Username; } return comment; }
public ActionResult Edit(int? userId) { if (userId.HasValue) { using (RentItServiceClient proxy = new RentItServiceClient()) { User user = proxy.GetUser(userId.Value); if (user != null) { Account acc = new Account(); acc.UserId = user.Id; acc.CurrentEmail = user.Email; acc.CurrentUsername = user.Username; return View(acc); } } } return RedirectToAction("Index", "Home"); }