Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update RayController.cs #1

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Update RayController.cs
  • Loading branch information
Dedac authored Sep 4, 2024
commit b904fbd627738c0ce40b392693acb980da5f3df7
11 changes: 7 additions & 4 deletions Beam.Server/Controllers/RayController.cs
Original file line number Diff line number Diff line change
@@ -20,9 +20,12 @@ public RayController(Data.BeamContext context)
[HttpGet("user/{name}")]
public List<Ray> GetRaysByUser(string name)
{
return _context.Rays.Include(r => r.Prisms).ThenInclude(p => p.User).Include(r => r.User)
.Where(r => r.User.Username == name)
.Select(r => r.ToShared()).ToList();
return _context.Rays.AsNoTracking()
.Include(r => r.Prisms).ThenInclude(p => p.User)
.Include(r => r.User)
.Where(r => r.User.Username == name)
.Select(r => r.ToShared())
.ToList();
}

[HttpGet("userprisms/{name}")]
@@ -55,4 +58,4 @@ public List<Ray> Add([FromBody] Ray ray)
}

}
}
}
Loading