Exemplo n.º 1
0
        private Url PopulateUsername(Url url)
        {
            UserRepository userRepo = new UserRepository();
            string         userId   = url.UserId == null ? "" : url.UserId;

            url.Username = userRepo.GetUsername(userId);
            return(url);
        }
Exemplo n.º 2
0
        private Url PopulateUsername(int id)
        {
            Url            url      = (from u in urls where u.Id == id select u).Single();
            string         userId   = url.UserId == null ? "" : url.UserId;
            UserRepository userRepo = new UserRepository();

            url.Username = userRepo.GetUsername(userId);
            return(url);
        }