LINQ & Entity
Entities 시퀸스 가져오기
스티커
2019. 8. 22. 12:26
시퀸스 생성하는 프로시저 만들기
엔티티 모델에서 프로시저 등록하기
가져오기
public int GetProgramSeq()
{
int i = 0;
using (PbotEntities ctx = new PbotEntities())
{
var results = ctx.SP_GET_SEQ_PROGRAM();
long? nextSequenceValue = results.SingleOrDefault();
if( int.TryParse( nextSequenceValue.Value.ToString() , out i ))
{
i = int.Parse(nextSequenceValue.Value.ToString());
}
return i;
}
}