Entity Frame 5.0 question.
I am new to Entity Frame, basically I have a table “MyPIN”.
[Table("MyPIN")]
public class BatchPINDetail
{
public BatchPINDetail();
public int Number { get; set; }
I want to run a query
int x = the biggest Number FROM MyPIN
The correspond codes are:
public class InContext : DbContext
{
public InContext();
public InContext(string connectionString);
public DbSet<BatchDetail> BatchDetailsRecords { get; set; }
}
Question 1: I am not sure how to retrieve it.
Question 2: After I get the value, I want to reassign the value, say Number += 1; I need to write it to DB.
Thanks for help.
1 Answer