Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class MyCustomController : BaseController
- {
- TBTEntities db;
- public ActionResult Abcdef()
- {
- // burda direk db yi kullansak nasıl olur
- db.tabloadi.where(.....).....
- return View();
- }
- public ActionResult Xyzzzz()
- {
- // yada using blockları içinde çağırsak
- using (var database = new TBTEntities())
- {
- database.tabloadi.where(.....)....
- }
- return View();
- }
- public MyCustomController()
- {
- // burda Entity nesnemi yarattım
- db = new TBTEntities();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement