You can create a class like the following
public class Integer
{
public int Id { get; init; }
public Integer(int id)
{
Id = id;
}
}
Pass it to a method which can use it but not alter Id property
This browser is no longer supported.
Upgrade to Microsoft Edge to take advantage of the latest features, security updates, and technical support.
How can I prevent parameter tampering in my code below?
var MyTest = await _context.MyTable.Where(x => x.ID == EmployeeID).ToListAsync();
You can create a class like the following
public class Integer
{
public int Id { get; init; }
public Integer(int id)
{
Id = id;
}
}
Pass it to a method which can use it but not alter Id property
This is a .Net question.
.Net support is on stackoverflow. I suggest you post your question here: