Lập trình ASP.NET MVC – Bài 12: Tạo tầng Data Access với EF CodeFirst | Create Data access layer

44
34



Lập trình ASP.NET MVC – Bài 12: Tạo tầng Data Access với EF CodeFirst | Create Data access layer

Mã nguồn bài học Onlineshop:
Khóa học làm việc chuyên nghiệp với ASP.NET MVC AngularJS, WebAPI:
Bài học này các bạn sẽ được hướng dẫn cách tạo 1 tầng truy cập dữ liệu SQL Server thông qua Entity Framework Codefirst trong Visual Studio 2015.
Các bạn có thể xem các bài học mới tại đây: youtube.com/myskillscenter

▶ More information about TEDU:
Website:
Hotline: 0966 036 626
Email: tedu.international@gmail.com

▶ CLICK TO SUBSCRIBE:
#tedu #aspnetmvc

DO NOT REUPLOAD

Nguồn: https://technewsgator.com

Xem thêm bài viết khác: https://technewsgator.com/lap-trinh/

44 COMMENTS

  1. Tính ra entity tù quá ta. mỗi lần thềm gì ở database là phải chỉnh lại hết. nv tính ra dùng proceduce vẫn là tốt nhất

  2. toang r a oi…cái đata của e nó ko có ado.net và e cài thêm cái entity a bảo nó báo visual studio product directory is not found

  3. a ơi. khi e add area thì báo lỗi:
    there was an error running the selected code generator: 'the value-1 is outside the acceptable range of [0,2147483647]. Parameter name:value'
    sửa sao vậy a.tks

  4. anh ơi sao em khai báo biến db là OnlineShopDbContext không được hả anh?
    Error CS0116 A namespace cannot directly contain members such as fields or methods

  5. A ơi cho e hỏi lúc kết nối với SQL lúc 2:02 nó hiện lỗi : "Could not load file or assembly 'office, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. The system cannot find the file specified.The system cannot find the file specified" sửa như thế nào ạ.
    Cám ơn a.

  6. Anh ơi , cho em hỏi phút thứ 9:25 : db.User.COunt( x=>x.UsersName)
    . x ở đây là gì vậy a ?

  7. + em bị lỗi ngay khúc tạo Controllers ở Area/Admin :
    There was an error running the selected code generator: Could not load file or assembly 'Model.dll' or one of its dependencies
    + mà không tạo ra Model rời thì lại tạo Controllers được ?

  8. cho em hỏi, chỗ connection properties, sao em nhập mật khẩu rồi mà chỗ connect to a database không hiện lên ạ

  9. Cảm ơn anh nhiều nhé, em mới coi vài bài thôi nhưng qua cách anh rep cmt là em thấy a hơn thấy nhiều người dạy trên đây. Tks anh

  10. A ơi tại sao e khai báo using mode.Dao trong logincontroller không được v anh… 5p10s… Cảm ơn a ạ

  11. sao cái EF của e ko kết nối được với database vậy ạ,nó báo ko tìm dược database,chỉ hộ e với ạ

  12. ở 2:01 mình có add database và cũng ấn test connection thì cũng thông báo giống như bạn nhưng khi mình ấn ok thì nó thông báo lỗi could not load file or assembly microsoft.sqlserver.management.sdk.sf…, mình không biết cách khắc phục như thế nào mong bạn giúp mình

  13. Em mới học lập trình nên chưa hiểu lắm , anh cho em hỏi chỗ hàm insert sao mình lại phải add cái entity vào User để làm gì vậy ạ

  14. Severity Code Description Project File Line Suppression State
    Error CS1061 'PrimitivePropertyConfiguration' does not contain a definition for 'IsFixedLength' and no extension method 'IsFixedLength' accepting a first argument of type 'PrimitivePropertyConfiguration' could be found (are you missing a using directive or an assembly reference?) Kenoi C:UsershuuDesktopShopShopOnlineKenoiEFDbContext.cs 143 Active
    lỗi này la sao v ad

  15. mình bị lỗi lúc tạo controller trong areas:
    there was an error running the selected code generator:
    'Could not load file or assembly 'Model.dll' or one of its dependencies. The system cannot find the file specified.'
    Ad giúp mình với

  16. An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. Chạy lên lỗi này là sao ạ

  17. Anh ơi có thể nói rõ hơn vấn đề thêm một trường mới vào bảng không?
    Giả sử em muốn thêm một trường Gender vào bảng User thì phải làm thế nào ạ.
    Em cảm ơn anh!

  18. em đặt 1 breakpoint khi nhấn F5 thì cái breakpoint ko chuyển thành mũi tên để nhấn F10 là bị sao ạ

  19. E làm đến Tạo một cái controller mới thì nó thông báo lỗi " Could not load file or assembly 'Model.dll' or one of its dependencies " . Mong a chỉ cho e cách fix lỗi này . thanks a

  20. 🙁 sao em connect nó báo lỗi "… named pipes provider could not open a connection to sql server Error 40 .." giúp em với

  21. Anh cho em hỏi là bảng User là gộp 2 bảng nhân viên với khách hàng lại với nhau đó đúng ko anh

  22. Bạn ơi cho mình hỏi cái giá trị status trong bảng user của bạn là bool mà của mình là bool? ?Vì của mình là bool? nên mình không để item.Status ? "" : "" được

  23. E có 1 thắc mắc. Khi e references từ OnlineShop với Model thì bên OnlineShop không tạo được controller nhưng khi e kết nối từ Model sang OnlineShop thì lại được. Tại sao nó lại như vậy ạ a.
    Cảm ơn!

  24. Chán nhỉ, đang học thủ tục hay mà sao lại chuyển sang LINQ nhỉ. Việc gọi sp từ SQL Server lên mở ra nhiều hướng phát triển luồng xử lý có nhiều ưu điểm hơn LINQ

  25. Anh ơi, tạo thêm cột "Confirmpasword" để validDate password trong code first nhưng lúc insert vô thì báo lỗi "Validation failed for one or more entities. See 'EntityValidationErrors' property for more details." Giúp em với.

  26. Trường hợp khi mình thêm mới bảng trong database. Mình muốn add thêm trong code first thì làm sao hả add. (Vì mình muốn giữ lại thuộc tính invalid form của những bảng khác như trong bài số 8)

  27. Bạn cho hỏi: Đổi tên "OnlineShop" thành "OnlineShopDbContex" có ý nghĩa gì không? Hay chỉ là để tường minh nó là tên chuỗi kết nối?

LEAVE A REPLY

Please enter your comment!
Please enter your name here