Bài đăng

Responsive cho Video

To scale a YouTube video to fit any browser or tablet/mobile device for responsive design you can use either a CSS or Javascript solution to accomplish the goal. This example uses a CSS solution, you need to add a couple of CSS styles in your main CSS file. The Process The first thing that you need is the YouTube iframe embed code, grab that in your video share options from the YouTube site. Place the iframe code on your page, in this example above the iframe's container div (div.youtubevideowrap)  has 2 CSS declarations for width, it has a  width:80%  and a  max-width:640px . This makes the content fluid as a percentage unit is used, it also has a max-width set as I don't want the video displaying wider than 640px From here we need to add in a HTML container around the video and declare the CSS. Setting Up the HTML and CSS Styles Create a container div around the iframe code and give it a class eg: <div class="video-container"><iframe......

Tổng quan kiến trúc của Entity Framework

Hình ảnh
ADO.NET Entity Framework là một nền tảng được sử dụng để làm việc với database thông qua cơ chế ánh xạ Object/Relational Mapping (ORM). Nhờ đó, bạn có thể truy vấn, thao tác với database gián tiếp thông qua các đối tượng lập trình. Kiến trúc của Entity Framework được minh họa như sau: Các nội dung dưới đây sẽ đi vào giải thích từng phần trong sơ đồ trên. Trong giới hạn của bài viết, tôi chỉ đi khái quát để bạn nắm được nội dung chính. Trong thực tế, bạn cũng không cần biết sâu hơn về kiến trúc bên dưới trừ những mục đích đặc biệt. Object Services Đây là các class tự động sinh ra tương ứng với mô hình dữ liệu. Các class này bao gồm: –       ObjectContext  đại diện cho một database. ObjectContext có chức năng quản lý các kết nối, định nghĩa mô hình dữ liệu với metadata và thao tác với database. Lớp này cũng có thể thêm vào các phương thức đại diện cho các stored procedure trong database. –       ObjectSet<TEntity>  là một  một tập hợp các entity. Mỗi đối tượng này