title: Using angulars ngResource get method
body: <p>I have a basic controller defined in C#, its only purpose is to return whoever the current user is. </p>
  
  <pre><code>    namespace ProjectName.Controllers
  {
      public class UserController : ApiController
      {
  
  
          // GET api/user/
          public string Get()
          {
              return User.Identity.Name;
          }
  
      }
  }
  </code></pre>
  
  <p>I then have an ngResource defined to look at that controller </p>
  
  <pre><code>cript.factory('User', function ($resource) {
  return $resource('/api/User')
  });
  </code></pre>
  
  <p>finally I try to get that user in my Angular Controller </p>
  
  <pre><code>    $scope.checkIfAuth = function () {
      $scope.user = User.get();
  
      console.log($scope.user);
  
      if ($scope.user === '"DS//:lemieszr"') {
          console.log("success");
      }
  };
  </code></pre>
  
  <p>The problem is $scope.user is a resource object that looks like this </p>
  
  <pre><code>    Resource {$get: function, $save: function, $query: function, $remove: function, $delete: function}
      0: """
      1: "D"
      2: "S"
      3: "\"
      4: "\"
      5: "l"
      6: "e"
      7: "m"
      8: "i"
      9: "e"
      10: "s"
      11: "z"
      12: "r"
      13: """
      __proto__: Resource
  </code></pre>
  
  <p>Is there anyway to just get the string containing my Username. User.query() only returns an empty array.</p>