ASP.NET MVC

Fluent API Basic

Source: Mosh Hamedani 1. Table Name modelBuilder.Entity().Totable(“tbl_Course”); 2. Table Name and Schema modelBuilder.Entity().Totable(“tbl_Course”,”schema”); 3. Primary Keys modelBuilder.Entity().HasKey(t => t.ISBN); 4. Composite Keys modelBuilder.Entity().HasKey(t => new {t.OrderId, t.OrderItemId}); 5. Column Name modelBuilder.Entity() .Property(t => t.Name) .HasColumn(“sName”); 6. Column Type modelBuilder.Entity() .Property(t => t.Name) .HasColumnType(“varchar”); 7. Column Orders modelBuilder.Entity() .Property(t => t.Name) .HasColumnOrder(2); 8. Database Generated modelBuilder.Entity()… Continue reading Fluent API Basic

ASP.NET MVC

Data Annotation Entity Framework

Source: Mosh Hamedani 1. Table Name [Table(“tbl_Course”, Schema = “”)] public class Course 2. Column Names [Column(“sName”, TypeName=”varchar”)] public string Name {get; set;} 3. Primary Key [Key] DatabaseGenerated(DatabaseGeneratedOption.None)] public string ISBN {get; set;} Lưu ý: DatabaseGeneratedOption có 3 thuộc tính: None, Identity và Computed 4. Composite Keys public class OrderItem { [Key] [Column(Order=1)] public int OrderId… Continue reading Data Annotation Entity Framework

ASP.NET MVC · Uncategorized

Code! MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on

Source: https://docs.microsoft.com/en-us/aspnet/mvc/overview/security/create-an-aspnet-mvc-5-app-with-facebook-and-google-oauth2-and-openid-sign-on   Getting Started Start by installing and running Visual Studio Express 2013 for Web or Visual Studio 2013. Install Visual Studio 2013 Update 3 or higher. For help with Dropbox, GitHub, Linkedin, Instagram, buffer, salesforce, STEAM, Stack Exchange, Tripit, twitch, Twitter, Yahoo and more, see this one stop guide.1 Note You must install Visual… Continue reading Code! MVC 5 App with Facebook, Twitter, LinkedIn and Google OAuth2 Sign-on

IT · Uncategorized

Capture Traffic from Another Machine (Any OS)

Set Remote Machine Proxy Settings Start Fiddler on Fiddler server (the machine that will capture the traffic). Click Tools > Fiddler Options. Ensure Allow remote clients to connect is checked. On the other machine, set the proxy settings to the machine name of the Fiddler server at port 8888. Decrypt HTTPS traffic from the Remote… Continue reading Capture Traffic from Another Machine (Any OS)

IT

Hướng dẫn tạo bộ cài macOS Sierra chính thức trên USB

Link : https://applife.vn/21080/huong-dan-tao-bo-cai-macos-sierra-chinh-thuc-tren-usb.html Yêu cầu: Máy Mac hỗ trợ macOS Sierra. (danh sách xem ở đây) 01 thanh USB 8GB trở lên, trống. Tài khoản Apple ID. Đường truyền Internet tốc độ cao để tải bộ cài macOS Sierra. Tiến hành: Bước 1: Tải về bộ cài macOS Sierra Khởi động Mac App Store, sau đó… Continue reading Hướng dẫn tạo bộ cài macOS Sierra chính thức trên USB

Linux

How To Set Up a Firewall with UFW on Ubuntu 14.04

Link : https://www.digitalocean.com/community/tutorials/how-to-set-up-a-firewall-with-ufw-on-ubuntu-14-04 Introduction UFW, or Uncomplicated Firewall, is an interface to iptables that is geared towards simplifying the process of configuring a firewall. While iptables is a solid and flexible tool, it can be difficult for beginners to learn how to use it to properly configure a firewall. If you’re looking to get started securing… Continue reading How To Set Up a Firewall with UFW on Ubuntu 14.04