calling stored procedure in c# entity framework
using (var db = new SyXEntities())
{
var repeatDetails = db.Database.SqlQuery<RepeatBetDetail>("Get_RepeatBetDetails @BetID", new SqlParameter("BetID", betID)).ToList();
return repeatDetails;
}
calling stored procedure in c# entity framework
using (var db = new SyXEntities())
{
var repeatDetails = db.Database.SqlQuery<RepeatBetDetail>("Get_RepeatBetDetails @BetID", new SqlParameter("BetID", betID)).ToList();
return repeatDetails;
}
entity framework call stored procedure with parameters
using (var entities = new YourEntities())
{
SqlParameter[] parameters =
{
new SqlParameter{
SqlDbType = SqlDbType.NVarChar,
Size = -1,
Direction = ParameterDirection.Input,
ParameterName = "InCompanyCode",
Value = SD.Company
},
new SqlParameter{
SqlDbType = SqlDbType.NVarChar,
Size = -1,
Direction = ParameterDirection.Input,
ParameterName = "InDebugModeOn",
Value = "0"
}
};
return entities.Database.SqlQuery<Your_Model>
(@"EXECUTE YourSP @InCompanyCode,@InBranchCode", parameters).ToList(); }
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us