public IHttpActionResult Get(string username) { var entity = Svc.GetByUserName(username); if (entity == null) { return(NotFound()); } var item = new UserProfileDto(); item.LoadFromEntity(entity); return(Ok(item)); }