IT

Add Mongo’s bin folder to the Path Environment Variable

You need to add Mongo’s bin folder to the Path Environment Variable. Here’s how on Windows 10: Find your bin folder. If you’re not sure where it is, it’s probably in C:\Program Files\MongoDB\Server\3.4\. It should look like this: Copy the path to the bin folder, this should be C:\Program Files\MongoDB\Server\3.4\bin Press win, type env, Windows… Continue reading Add Mongo’s bin folder to the Path Environment Variable

Uncategorized

Why would you use Expression<Func> rather than Func?

Source: http://stackoverflow.com/questions/793571/why-would-you-use-expressionfunct-rather-than-funct   Thấy có bài viết trên stackoverflow về expression, nên add vào blog để lưu 😀 Issue:  I understand lambdas and the Func and Action delegates. But expressions stump me. In what circumstances would you use an Expression<Func<T>> rather than a plain old Func<T>? Ans: When you want to treat lambda expressions as expression… Continue reading Why would you use Expression<Func> rather than Func?

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)