@manhng

Welcome to my blog!

Fundamentals Concepts in C#, ASP.NET, WCF

March 27, 2022 11:08

Fundamentals Concepts in C#, ASP.NET, WCF (edit)

var vs dynamic key word
multicast delegate, what happens if 3 methods returns 3 diff types
Binary search over linear search
Rest Services
WCF: logging client ip on server side without adding it from wcf client using message inspector
HTTP handler over .aspx files
Events fires in iis when hitting an aspx page
Thread Safety in singleton
project architecture
design pattern used in ur project
SP/Triggers/Functions 
select a date in back and get all months having first day as Sunday.
What is IDisposable
-------------------------------------------------------------------
what is impersonation.
Diff between cluster and non-cluster index
impact on performance using indexes
when to use structure over class

------------------------------------------------------------------
method overloading in wcf.
can we use WCF service dll in a client witout using endpoints.
diff between class and interface.
what's new in sql server 2008
what's new in C# 4.
How would you improve performance of a SP
generate a hierarchy from a table having data with parent-child relation
steps in code review
what warning we face if a virtual method of base class is not overridden in child class
what is static class
dispose vs finalize
role of using key world in c#
if we don't use [OperationContract] then what would will happed?
when we create a asp.net wcf website, then name the three major files.
for a private assembly LocalCopy is true or false
what is CLS
--------------------------------------------------------
What is dirty read?
Where SQL jobs are stored?
What is locking?
Diff between AngularJS and javascript?
What is role of script manager?
diff between varchar and nvarchar?
SQL Server Performance tuning.
----------------------------------------
what is ABC in WCF
what types of binding available in WCF
diff between . and # in jQuery
write a code block to call ajax call in jquery
diff table variable and temp table 
diff between cluster and non-cluster indexes
scope of CTE?
types of cacheing?
constant vs read only fields

when we hit like x.com, what events fires in IIS
code for writing factorial
diff IEnumberable and IList
what is HTTP handler? and tell about IHttpHandler interface
types of state management options in .NET
page life cycle
sequence of module and handler (mhpm)
DIFF INTERFACE AND CLASS
how we can remove sub-query from SELECT * FROM EMP where ID is not in (sub query)?
types of joins?
custom http handler for image/pdf file.


REST services
write code to print Fibonacci series
alternative of cursor
what new is in C#
query to remove duplicate records from a table.
query to get parent child relationship from a table using self join and CTE
what is full outer join and cartesian join
Less.js?
Angular.js vs Knockout.js vs Node.js? what is less.js?
what is CTE?
PLINQ?
COALESCE?
ROW_RANK?
what is static class
how to prevent inserting multiple rows in DB (use unique constraint)

public class Emp { public void GetAge() {return 45;} }
public class Emp1 : Emp { public void GetAge() {return 45;} }
will it compile?

query for concatenating column values separated by ',' for each customer
types of triggers?
DIFF INTERFACE AND CLASS
protection level and security in WCF

how to handle thousands of hits in sql server db instance? suggest options?
what is GAC
----------------------------------------
int Sum(int32 x, int 32y)
int Sum(int64 x, int64 y)
will above code compile ? if then on executing code Sum(1,2), which one will be invoked?


diff types of state management techniques
in-proc and out of proc session state management
Web Farm and Web Garden?
diff between delete and truncate
what is collation 
diff table variable and temp table
diff between cluster and non-cluster indexes
can we use try catch block in a cursor to ignore an error.
what is CTE?
how we can improve sql server performance
code review techniques?
what is DCL?
how can we improve performance of sp
what is co-related sub query?
what would you prefer? inline query or SP?
can we put redirect link in a gridview control and how
how to improve asp.net page performance  
WHAT IS MULTILEVEL AND MULTIPLE INTERFACE?
IS C# SUPPORTS MULTIPLE INHERITANCE?
what is pillars of OOPs? 
What are SDLC?
basics about scrum?
what are views? can we delete/update/add records using views?
in asp.net page there is master page, then page, then two user controls in page. if one clicks on user control button then, what are event sesuencing?
types of cacheing?
how many non-cluster can we have?
what is IsPostBack?
waht are ASP.NET temporary files?
diff between dataset and data reader?
val and ref types, heap and stack and boxing and unboxing
a class have an int field. so where int field would be stored?
Multilevel and multiple inheritance in C#.


singleton design pattern
proxy
observer
----------------------------------------------------------------------------------------

WAP to check for palindrome number
get first two numbers from a sorted array of ints whose sum is 47. Also optimize it order.
what is WCF?
Types of filter types in WCF routing service?
Service versioning via routing and service contract.
protocol bridging in wcf routing service.
getting sum of +ve and -ve number from a int column in sql server
-------------------------------------------------------------------------------------
What are the challanges to deploy a website in Load Balancing environment?
HTTP Handler to fetch imges from database?
How QA process is done in MIS?
What is single sign off?
How to manage file saving in load balancing mode?
WCF security, How authentication is manage in WCF and who manages certificates/token?
----------------------------------------------------------------------------------------
WAP to count occurrence of 'o' in a given string.
WAP to count total numbers of zeros from 1 to n.
-------------------------------------------------------------------------------------
WAP to eliminate duplicate occurrence of integers from a set = {1,1,1,2,3,3,4,4,4,4,9,9}
WAP for simple Threading in C#.
There are four interfaces having a method with same name. How a class implements these interfaces?
An Interface has four methods say m1,m2,m3,m4. Now there is a base class A and a child class of A
say B. A implements Interface. Now design class A and B such that A override methods m1 and m2 & B override m3 and m4.
-----------------------------------------------------------------------------------------------------------------------------
types of functions in SQL and how we can use table valued function in SP
diff CTE and temp table
performance of SP
default isolation level for the Microsoft SQL Server Database Engine
HTTP Handler and give an example of the same in your project
Why you have static classes for utility class
Can a class has private access specifier?[You can create a private class, as a member of another type]
if we disable cookie, then how form authentication work?
Fault Contract and structural fault handling in WCF
Entity Framework: how you will save and entity in DB
Exception handling in your project.
single sign on and WIF
-------
----------------------------------------------------------------------------------------------------------------------------
how to update product price category wise?
order of execution of instance and static constructors in a class hierarchy.
How instance and class level members and variables are stored in memory.
what is form authentication.
what is impersonation.
page life cycle in master, parent and child controls.
how to improve performance of a sp.
CTE and diff between table variable and CTE.
temp tables?
diff between factory and IOC.
locking and read only cursor.


what is lambda expression.
which design pattern you have used in your project?
-----------------------------------------------------------------------------------------------------------------------------
new features of SQL Server 2008.
there is a virtual method in a base class and a child class override that method. Now there is another child of child class.
We want to prevent that method to be overridden in second child class. how will do that?
Class vs interface.
there is button control on a web page. now we refresh that page. which events would be fired again?
On successive click on a button how we prevent multiple saving in DB from code?
 how to take left outer join in LINQ.
-----------------------------------------------------------------------------------------------------------------------------
what is polymorphism.
thread safe singleton pattern.
class vs interface.
in a maintenance state, what would you prefer? abstract class or interface.
request handling in IIS.
diff between factory and IOC.
---------------------------------------------------------------------------------------------------------------------------
Fault and Fault Contract.
Façade design pattern.
Diff Factory and Abstract Factory.
Why LINQ is slow.
There are n number of services endpoints but client doesn't want to expose them in client project but single at a time. what
would be the solution?
-----------------------------------------------------------------------------------------------------------------------------
How to handle 500 users in IIS.
Load balancer in IIS.
ABC in WCF.
Diff types of Binding in WCF.
How to decide type of a binding to be used.
REST and types of binding to prefer for REST and why.
Why we prefer REST.
diff between udf. and sp.
--------------------------------------------------------------------------------------------------------------------------------
 

WCF vs ASMX
Connection pooling
in which even we have to add attribute in controls
iis recycle
can we rename .asmx file .svc?


points to be considered while deploying the application over load balancer
--------------------------------------------------------------------------------------------------------

Method Level Security in WCF
LOCKING using EF
Binding for backward compatibility
WCF security
Unity vs MEF


SOLID and best practices
MVC vs MVVM
How to use observer design pattern
How to use MEF for extensibility


WCF service versioning
ORM over ADO.NET
Method overloading in WCF
------------------------------------------------
can private virtual method overridable in child class?
can class constructor has return type?
class vs interface?
can normal class can has abstract method
dispose vs finalize
can multiple catch block be executed
name some of exception in c#
value vs ref type. name some of them
how to implement priority que?
what data structure you would use for recursion?
MSMQ
user control vs custom control
serialization


how to know that which WCF service is hitted most?
in which scenario Web API would be better
why not you replace your wcf web services by web API
wcf vs asmx

how to know that which aspx page is hitted how many times?
how to maintain states for user level and for page level?
jQuery vs JavaScript

primary key vs unique key?
can all column of unique be not null
what is composite primary key
DBMS vs RDMBS
delete, truncate, drop
DML, DDL, TCL, DCL
union, intersection and diff operator
types of joins

References

https://docs.microsoft.com/vi-vn/dotnet/framework/wcf/wcf-and-aspnet-web-api

https://gist.github.com/gtechsltn/e8ae20408263c033a00eede869472176

https://gist.github.com/akhilbhardwaj23/1312657e88e4e70400c2

https://medium.com/@smitagudale712/cartesian-product-vs-full-outer-join-in-sql-server-5742a67c656f

https://www.c-sharpcorner.com/UploadFile/b19d5a/full-outer-join-and-cross-join-in-sql-server-2008/

WCF

Basic Concepts of WCF Service With simple Example. - DotNetFunda.com

A Beginner's Tutorial for Understanding Windows Communication Foundation (WCF) - CodeProject

Fundamental Windows Communication Foundation Concepts - WCF | Microsoft Docs

WCF Tutorial for Beginners with Example in Asp.Net Step By Step - ASP.NET,C#.NET,VB.NET,JQuery,JavaScript,Gridview (aspdotnet-suresh.com)

1.3. Fundamental WCF Concepts - Learning WCF [Book] (oreilly.com)

WCF and ASP.NET Web API - WCF | Microsoft Docs

WCF: Không dùng với SignalR được

Web API: Có thể dùng SignalR

WCF + Web API - Advanced Concepts

WCF Proxy Cookie Inspector

WCF - Authentication and Authorization in Enterprise Architecting (c-sharpcorner.com)

Cookie in ASP.NET Web API

How To Set Cookies in ASP.NET Web API (c-sharpcorner.com)

Cookie (HAY HAY HAY)

Cookie Resources (c-sharpcorner.com)

Oracle ASP.NET Google

January 7, 2022 16:03

Oracle ASP.NET Google (edit)

How to use OracleMembershipProvider in ASP.NET MVC Application​

c# - oracle database connection in web.config asp.net - Stack Overflow

NuGet Gallery | Oracle.Web 21.5.0

ASP.NET Membership Management Tool

sthakuri/ASP.NET-Membership-Management-tool: ASP.NET Membership Management Tool (github.com)

Oracle Data Access Components (ODAC)

Oracle Developer Tools for Visual Studio

Oracle Data Provider for .NET (ODP.NET)

oracle/dotnet-db-samples: .NET code samples for Oracle database developers (github.com)

Overview of Oracle Providers for ASP.NET

Oracle Providers for ASP.NET offer ASP.NET developers an easy to use method to store application state common to web applications (such as web user information, shopping carts) within an Oracle database. These providers are modeled on existing Microsoft ASP.NET providers, sharing similar schema and programming interfaces to provide .NET developers a familiar interface.

Oracle supports the following providers:

  • Membership Provider

  • Role Provider

  • Site Map Provider

  • Session State Provider

  • Profile Provider

  • Web Events Provider

  • Web Parts Personalization Provider

  • Cache Dependency Provider

Each ASP.NET provider can be used individually or in combination with other Oracle ASP.NET providers for your web site. Each of them store a specific set of web site information.

Oracle Providers for ASP.NET classes, their use, installation, and requirements are described in Oracle Providers for ASP.NET Developer's Guide, which is also provided as dynamic help.

Oracle Providers for ASP.NET Installation

Configuring Oracle Providers for ASP.NET Individually

Applications may not require all Oracle Providers for ASP.NET. Providers can be set up individually. Except for the Oracle Session State Provider and Oracle Cache Dependency Provider, the following install script must be executed before any other install scripts. Then, for each Oracle Provider for ASP.NET, a SQL script specific for that provider must be executed (in any order).

These install scripts are found in the ORACLE_BASE\ORACLE_HOME\ASP.NET\sql directory.

Table 1-2 Provider Installation Scripts

Provider Required Installation Script

Oracle Membership Provider

InstallOracleMembership.sql

Oracle Personalization Provider

InstallOraclePersonalization.sql

Oracle Profile Provider

InstallOracleProfile.sql

Oracle Role Provider

InstallOracleRoles.sql

Oracle Session State Provider

For Oracle Database 10g Release 1 and later InstallOracleSessionState.sql

For Oracle Database 9i Release 2 InstallOracleSessionState92.sql

There are correspondingly named uninstall scripts for these install scripts.

Note: This provider only requires the execution of the appropriate provider-specific .sql script as listed. It does not require the execution of InstallOracleASPNETCommon.sql.

Oracle Site Map Provider

InstallOracleSiteMap.sql

Oracle Web Events Provider

InstallOracleWebEvents.sql

Oracle Cache Dependency Provider

No script execution needed

General Setup Information

Once InstallOracleASPNETCommon.sql runs and calls the individual installation scripts, the installation scripts, in turn, execute corresponding .plb scripts, which create the stored procedures and functions. The installation .sql scripts must execute where the .plb file can be accessed.

Each provider also provides corresponding uninstall scripts to remove database objects that were created from the install scripts. These scripts are prefixed with the word Uninstall.

ASP.NET Client Setup

Installation configures the machine.config file to enable Oracle Providers for ASP.NET systemwide. Users can use the ORACLE_BASE\ORACLE_HOME\ASP.NET\Bin\2.x\OraProvCfg utility to configure the provider-specific entry in the machine.config file as follows:

  • To display the OraProvCfg utility help:

    OraProvCfg -help 
    
  • To add Oracle Providers for ASP.NET-specific entries to the machine.config file:

     OraProvCfg  /action:config  /product:aspnet  /component:all
                 /frameworkversion:v2.0.50727
                 /providerpath:c:\Oracle\odp.net\bin\2.x\Oracle.Web.dll
    

    Where Framework version and Provider path (especially) may need to change accordingly.

  • To remove the Oracle Providers for ASP.NET-specific entries from the machine.config file:

    OraProvCfg  /action:unconfig  /product:aspnet  /component:all
                /frameworkversion:v2.0.50727
    

Where Framework version may need to change accordingly.

After installation, developers must provide the connection information to the database schema that stores and retrieves the ASP.NET state information. This step requires developers to supply the User Id, Password, Data Source, and other connection string information if necessary. In the machine.config file, developers can provide an entry similar to the example below.

<connectionStrings>
<add name="OraAspNetConString" connectionString="User Id=aspnet;Password=aspnet;Data Source=oracle; " />
</connectionStrings>

Optionally, developers can customize the properties of each ASP.NET provider from within the <system.web> section of the machine.config.

While Oracle Universal Installer automatically configures the machine.config, developers can apply more fine grained application-level control over the Oracle Providers for ASP.NET by using the web.config file. This file overrides entries from the machine.config file, but only for the specific web application it is a part of. Developers can set up their web.config file with the same XML syntax as the machine.config file.

Oracle.DataAccess.Client

Web.config file for EPiServer 6.0.530.0 for IIS6 and Visual Studio development server (github.com)

OracleMembershipProvider

Managing Users by Using Membership | Microsoft Docs

OracleMembershipProvider

Migrate ASP.NET to Google Cloud Platform

Its show how to migrate existing legacy .NET application to Google Cloud Platform.

dotnet-docs-samples/applications/liftAndShiftPetshop at main · GoogleCloudPlatform/dotnet-docs-samples (github.com)

ASP.NET Membership and Role Provider using Oracle database

We all know that in ASP.NET 2.0 there are Built-In Providers to help developers to build a robust application.

  • Membership
  • Role management
  • Site map
  • Profile
  • Session state
  • Web events
  • Web Parts personalization
  • Protected configuration

What i want to write here is about Membership Provider and Role Provider,

Membership
System.Web.Security.ActiveDirectoryMembershipProvider
System.Web.Security.SqlMembershipProvider

Role management
System.Web.Security.AuthorizationStoreRoleProvider
System.Web.Security.SqlRoleProvider
System.Web.Security.WindowsTokenRoleProvider

ASP.NET Firebird Telerik Kendo UI

April 19, 2021 23:09

ASP.NET Firebird Telerik Kendo UI (edit)

  • ASP.NET MVC
  • MediatR
  • CQRS
  • Entity Framework
  • Firebird
  • Autofac
  • AutoMapper
  • DBeaver
  • Telerik UI for ASP.NET MVC
  • DevExpress ASP.NET MVC
  • jQuery Ajax
  • ASP.NET MVC Razor views
  • Unit Testing in .NET: The Complete Guide
    • What unit tests are
    • Advantages of unit testing
    • Disadvantages and limitations
    • Unit testing best practices
    • What Mocking is
    • Mocking frameworks
    • Executing unit tests with the help of a mocking framework
    • Introduction to code coverage
    • When to choose your tooling

Kendo UI:

First Steps with Your Kendo UI for jQuery Project Guide | Getting Started | Kendo UI for jQuery | Kendo UI for jQuery (telerik.com)

jQuery Demos and Examples with HTML5/JavaScript Source Code | Kendo UI for jQuery (telerik.com)

Twitter Bootstrap and jQuery Responsive Demo | Kendo UI for jQuery (telerik.com)

Tales of Kendo UI Awesomeness: AdvancedREI (telerik.com)

Telerik UI for ASP.NET MVC:

ASP.NET MVC Introduction | Telerik UI for ASP.NET MVC

Telerik UI for ASP.NET MVC Demos

ASP.NET MVC UI Controls for Fast App Development | Telerik UI for ASP.NET MVC

Kendo UI vs UI for ASP.NET MVC

Kendo UI
http://www.telerik.com/kendo-ui/

$("#countries").kendoAutoComplete({
...
});

Telerik UI for ASP.NET MVC
http://www.telerik.com/aspnet-mvc/

@(Html.Kendo().AutoComplete()
.Name("countries")
...
)

Kendo UI vs UI for ASP.NET MVC - Telerik Blogs (HAY HAY HAY)

Difference between KendoUI Professional and Kendo UI MVC | static void main(string[] args) (wordpress.com) (HAY HAY HAY)

UI for ASP.NET MVC vs Kendo UI Complete in Kendo UI for jQuery General Discussions - Telerik Forums (HAY HAY HAY)

The combination of two different Telerik products helps level the playing field for all types of web developers: Kendo UI and UI for ASP.NET MVC. Whether you are an enterprise ASP.NET developer, a JavaScript champion or someone in between, these web development tools are flexible and can adapt to your needs.

Kendo UI may be the only JavaScript framework that you need to add to your web project.

UI for ASP.NET MVC UI suite is squarely meant for ASP.NET MVC developers like you – allowing you to leverage all the Kendo UI client-side widgets through easy MVC wrappers.

UI for ASP.NET MVC is not just MVC wrappers for Kendo UI though – it also includes framework pieces and Visual Studio goodies for the .NET developer. Using Kendo UI widgets via UI for ASP.NET MVC suite gives you the client-side UI functionality while having all the server-side comforts.

Also note that Telerik UI for ASP.NET MVC includes server-side wrappers for Kendo UI Web, Kendo UI DataViz and Kendo UI Mobile.

Directly to your questions:

  • Kendo UI Web targets primarily desktop, but it is touch-enabled and will operate properly on mobile devices as well. Specifically for mobile development with adaptive look and feel on different platforms, you can employ Kendo UI Mobile.
  • Yes, you can use MVC Razor views for mobile development. Also note that Telerik UI for ASP.NET MVC includes server-side wrappers for Kendo UI Web, Kendo UI DataViz and Kendo UI Mobile.
  • The difference between Kendo UI Complete and UI for ASP.NET MVC is that the latter incorporates ASP.NET MVC server wrappers, which allow you to define your code logic in server code and utilize features of the ASP.NET MVC framework.

Finally, note that Telerik.Web.Mvc.dll is an assembly from a discontinued product (Telerik MVC Extensions). Its successor product code, Telerik UI for ASP.NET MVC, resides in Kendo.Mvc.dll.

Regards, Sebastian
Telerik

CQRS:

Video: Intro to MediatR - Implementing CQRS and Mediator Patterns - YouTube

Video: Vertical Slice Architecture - Jimmy Bogard - YouTube

Building MVC Jimmy Style (thefreezeteam.azurewebsites.net)

CQRS (martinfowler.com)

Command Query Separation (martinfowler.com)

PDF: CQRS Documents by Greg Young (wordpress.com)

MediatR:

Thin Controllers with CQRS and MediatR (codeopinion.com)

Thin Controllers using MediatR with ASP.NET MVC | Alex Lindgren

Simplify your controllers with the Command Pattern and MediatR (jonhilton.net)

Moving from Controllers and Actions to Endpoints with MediatR | Blog (ardalis.com)

ASP.NET

May 28, 2020 16:00

ASP.NET (edit)

This is my collection of sources of the most "relevant" information on ASP.NET MVC. Hope this helps you if you need information on MVC and web development with Microsoft Tools.

https://lionadi.wordpress.com/tag/asp-net/

https://github.com/pjmagee/CI3540

http://kevin-junghans.blogspot.com/2013/01/seeding-customizing-aspnet-mvc.html

https://weblogs.asp.net/jongalloway/simplemembership-membership-providers-universal-providers-and-the-new-asp-net-4-5-web-forms-and-asp-net-mvc-4-templates

http://aspnetmvceuropeanhosting.hostforlife.eu/post/European-ASPNET-MVC-4-Hosting-Amsterdam-Seed-Users-and-Roles-with-MVC-4-SimpleMembershipProvider-SimpleRoleProvider-EntityFramework-5-CodeFirst-and-Custom-User-Properties.aspx

ASP.NET MVC 5 Security And Creating User Role:

https://code.msdn.microsoft.com/ASPNET-MVC-5-Security-And-44cbdb97

ASP.NET MVC 5 Identity: Extending and Modifying Roles:

http://www.codeproject.com/Articles/727054/ASP-NET-MVC-Identity-Extending-and-Modifying-R

Generate the LLBLGen DAL code

https://www.mattjcowan.com/funcoding/2012/11/10/simplemembershipprovider-in-mvc4-for-mysql-oracle-and-more-with-llblgen/

SqlLocalDB

December 7, 2018 09:07

Cách sử dụng SqlLocalDB (edit)

https://docs.microsoft.com/en-us/sql/database-engine/configure-windows/sql-server-express-localdb?view=sql-server-ver15

https://docs.microsoft.com/en-us/sql/tools/sqllocaldb-utility?view=sql-server-2017

https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/working-with-sql?view=aspnetcore-2.2

https://docs.microsoft.com/en-us/aspnet/core/tutorials/first-mvc-app/working-with-sql?view=aspnetcore-2.2&tabs=visual-studio

https://docs.microsoft.com/en-us/previous-versions/visualstudio/visual-studio-2012/ms233817(v=vs.110)

Express

SELECT @@VERSION
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)   Sep 24 2019 13:48:23   Copyright (C) 2019 Microsoft Corporation  Express Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 19042: )

LocalDB

C:\Program Files\Microsoft SQL Server\150\Tools\Binn\SqlLocalDB.exe

SELECT @@VERSION
Microsoft SQL Server 2019 (RTM) - 15.0.2000.5 (X64)   Sep 24 2019 13:48:23   Copyright (C) 2019 Microsoft Corporation  Express Edition (64-bit) on Windows 10 Pro 10.0 <X64> (Build 19042: )

Guide: Start > Run > CMD

> SqlLocalDB.exe info
> SqlLocalDB.exe info v11.0
> SqlLocalDB.exe info MSSQLLocalDB
> sqllocaldb start

SQL Express 2012: (localdb)\v11.0

SQL Express 2014: (LocalDB)\MSSQLLocalDB

(localdb)\v11.0
(localdb)\MSSQLLocalDB

MVC Nerddinner, MVC Music Store

Visual Studio 2017, ASP.NET, Azure DevOps, and other Azure services

https://techbash.com/

Tối ưu mã HTML, CSS, JavaScript

August 4, 2018 16:39

Tối ưu mã HTML, CSS, JavaScript (edit)

Nén HTML và tối ưu hóa JavaScript

Sử dụng tool: https://csscompressor.net

Nén GZip với website ASP.NET 

Sử dụng tool: https://checkgzipcompression.com

https://thichchiase.com/web-design/nen-gzip-voi-website-asp-net-4-5-iis-8.html

Tối ưu hiệu suất và tốc độ website ASP.NET P1

Tối ưu hiệu suất và tốc độ website Asp.net P2

Tối ưu hiệu suất và tốc độ website Asp.net P3

Tối ưu hiệu suất và tốc độ website Asp.net P4

Tối ưu hiệu suất và tốc độ website Asp.net P5 

GZip trong ASP.NET MVC

https://weblog.west-wind.com/posts/2012/Apr/28/GZipDeflate-Compression-in-ASPNET-MVC

 

 

TDD with MVC Applications

July 30, 2018 23:08

TDD with MVC Applications (edit)

TDD With MVC 5 and Entity Framework and Repository pattern

https://code.msdn.microsoft.com/TDD-With-MVC-5-and-Entity-83ade5cf

Developing an ASP.NET MVC 4 Application for TDD using xUnit and Moq

https://github.com/dotnetcurry/tddusingxunit-dncmag-01

ASP.NET MVC 5 application with TDD using Unit testing framework (xUnit.NET) and Moking/Isolation framework (MOQ)

https://github.com/SanjeevForYou/TDDWithxUnitAndMOQ

TDD in ASP.NET MVC Applications with Moq Framework

https://kakimotonline.com/2011/02/13/tdd-in-asp-net-mvc-applications-with-moq-framework/

Unit Testing .NET Application with Moq Framework

https://kakimotonline.com/2011/01/02/unit-testing-net-application-with-moq-framework/

Test Driven Development in ASP.NET MVC 2

https://visualstudiomagazine.com/articles/2015/02/25/code-management-test-driven-dev.aspx

Test Driven Development in ASP.NET MVC 2

https://visualstudiomagazine.com/Articles/2015/05/14/Test-Driven-ASP-NET-MVC-2.aspx

TDD with .NET Core Web API

https://asp.net-hacker.rocks/2017/09/27/testing-aspnetcore.html

https://github.com/JuergenGutsch/blog/blob/master/_source/_posts/2017-09-27-testing-aspnetcore.md

 

 

Dapper Log4net AutoMapper

March 13, 2018 08:35

How to use the Dapper (edit)

- Create new ASP.NET Web Application called WebApplication1 (MVC: Web Forms, MVC, Web API) based on .NET Framework 4.5.2

- Nuget packages:

  + Install-Package log4net

  + Install-Package Dapper

  + Install-Package MySql.Data

  + Install-Package AutoMapper

  + Install-Package Newtonsoft.Json

- Web.config/App.config

  + Define connection string in <connectionStrings> or <appSettings>

- Controllers/HomeController.cs

- Documentation

Dapper with MS SQL Server

- Dapper with raw SQL

 

- Dapper with Stored Procedure

- Sample code

Dapper with MySQL

Nuget notes

+ .NET Framework 4.5
+ ASP.NET MVC 5.2
+ ASP.NET Web API 2.2
+ Web Pages 3.2

Update-Package
Install-Package jQuery -Version 1.12.4
Install-Package Bootstrap -version 3.3.7
Install-Package modernizr
Install-Package Newtonsoft.json
Install-Package log4net
Install-Package Dapper -Version 1.50.2 (.NET Framework 4.5)
Install-Package Microsoft.AspNet.WebApi (-Version 5.2.4)
Install-Package Swashbuckle (-Version 5.6.0)

Web API & Swagger + OAuth2
http://wmpratt.com/swagger-and-asp-net-web-api-part-1/

http://wmpratt.com/part-ii-swagger-and-asp-net-web-api-enabling-oauth2/

https://www.codeproject.com/Articles/1187872/Token-Based-Authentication-for-Web-API-where-Legac

http://bitoftech.net/2014/06/01/token-based-authentication-asp-net-web-api-2-owin-asp-net-identity/ 

ASP.NET Category

January 25, 2018 14:45

ASP.NET Category

https://blogs.technet.microsoft.com/wikininjas/2017/10/04/wiki-life-the-wait-is-over/

Points:

  • ASP.NET WebForm applications.
  • ASP.NET MVC applications.
  • ASP.NET Core
  • ASP.NET WEB API related topics
  • ASP.NET with combinations of JQuery, AJAX, JavaScript, AngularJs, Angular2, Angular4, Angular5 or any other scripting language
  • Languages can be VB.NET or C#.NET
  • Explain with images and source code, download links are a must for any application.

Syed Shanu

Email: syedshanumcain@gmail.com

http://shanucsharp.blogspot.kr

https://www.facebook.com/syed.shanu.9

https://www.facebook.com/ShanuCSharpDotNet/

https://www.codeproject.com/Articles/syed-shanu

http://www.c-sharpcorner.com/members/syed-shanu

https://mvp.microsoft.com/en-us/PublicProfile/5001980

ASP.NET Core 2 + Angular 5

https://github.com/MarkPieszak/aspnetcore-angular2-universal

*NEW* Angular 5.x Universal & ASP.NET Core 2.0 Advanced Starter - w/ server-side rendering for SEO, Bootstrap, i18n internationalization, TypeScript, unit testing, WebAPI REST setup, SignalR, Swagger docs, and more!

https://github.com/emonney/QuickApp

ASP.NET Core 2.0 / Angular 5 startup project template with complete login, user and role management. Plus other useful services for Quick Application Development

https://github.com/PacktPublishing/ASP.NET-Core-2-and-Angular-5

ASP.NET Core 2 and Angular 5, published by Packt

https://github.com/RobertDyball/A2SPA

SPA with ASP.NetCore 2 + Angular 4 + Bootstrap 4+ OpenIdDict

ASP.NET Core: Web API + Angular 4

http://www.c-sharpcorner.com/article/getting-started-with-asp-net-core-and-angular-4-using-web-api/

ASP.NET MVC: jQuery DataTables

http://www.c-sharpcorner.com/article/grid-view-with-server-side-advanced-search-using-jquery-datatables-in-asp-net-mv/

ASP.NET MVC: ASP.NET Identity + OWIN

http://bitoftech.net/2015/01/21/asp-net-identity-2-with-asp-net-web-api-2-accounts-management/

ASP.NET MVC: WEB API + Cookies

http://www.devcurry.com/2013/04/http-cookies-and-aspnet-web-api.html

http://www.binaryintellect.net/articles/0f52c5bf-b7a4-4720-9572-6159b1804d1d.aspx

ASP.NET MVC: ASP.NET Identity + OWIN + Cookies

http://benfoster.io/blog/aspnet-identity-stripped-bare-mvc-part-1

http://benfoster.io/blog/aspnet-identity-stripped-bare-mvc-part-2

Sourcehttps://github.com/benfoster/NakedIdentity

ASP.NET Core: ASP.NET Identity + Claims Based Identity + EF + Code First

http://sikorsky.pro/en/blog/aspnet-core-custom-user-manager

Sourcehttps://github.com/DmitrySikorsky/AspNetCoreCustomUserManager

ASP.NET MVC: Cookies + Web API

http://tostring.it/2012/12/03/manage-cookies-using-web-api/

ASP.NET MVC: Unit Testing with xUnit + Web API

http://tostring.it/2012/07/23/an-easy-way-to-write-an-integration-test-with-web-api/

ASP.NET Core: Unit Testing with xUnit

http://anthonygiretti.com/2018/01/19/code-reliability-unit-testing-with-xunit-and-fluentassertions-in-net-core-2-apps/

Dynamic Linq Queries

http://tomasp.net/blog/dynamic-linq-queries.aspx/

Database Samples

http://chinookdatabase.codeplex.com/

Chinook is a sample database available for SQL Server, Oracle, MySQL, etc. It can be created by running a single SQL script.

Chinook is a good name choice for a database that intents to be an alternative to Northwind.

ASP.NET CORE MIDDLEWARE

https://radu-matei.com/blog/aspnet-core-websockets-middleware/

First of all, it is important to understand what middleware is and how the new request pipeline works in ASP .NET Core, and there is a great article on that from the Official ASP .NET Core Documentation.

Middleware are software components that are assembled into an application pipeline to handle requests and responses. Each component chooses whether to pass the request on to the next component in the pipeline, and can perform certain actions before and after the next component is invoked in the pipeline. Request delegates are used to build the request pipeline. The request delegates handle each HTTP request.

Implement ASP.NET Security

November 10, 2017 17:17

Implement ASP.NET Security (edit)

Basically:

  1. Make a new user
  2. Make a new role
  3. Make a new Claim
  4. Add Claim to Role
  5. Add User to Role
  6. Make a new Policy with claim (during configure services)
  7. Check for user being authorized for policy

SQL Insert

https://stackoverflow.com/questions/41513890/creating-asp-net-identity-user-using-sql

How to create 100 users

https://stackoverflow.com/questions/41435437/creating-test-users-with-password-hash-in-asp-net-identity-2-2-1

public async Task CreateTestUsers() {

    var db = new ApplicationDbContext();
    var userStore = new UserStore<ApplicationUser>(db);
    var userManager = new ApplcationUserManager(userStore);

    for (var i = 1; i <= 100; i++) {
        var username = "User" + i;

        var user = db.Users.FirstOrDefault(u => u.UserName == username);
        if (user == null) {
            user = new ApplicationUser() {
                            UserName = username,
                            Email = username + "@" + username + "." + username,
                            EmailConfirmed = true,
                            LockoutEnabled = false
                        };

            var password = username;
            var result = await userManager.CreateAsync(user, password);
        }
    }
}

ASP.NET Web Security: Protect User Passwords with Hashing and Salt

http://www.itprotoday.com/web-development/aspnet-web-security-protect-user-passwords-hashing-and-salt

https://www.codeproject.com/Articles/844722/Hashing-Passwords-using-ASP-NETs-Crypto-Class

http://www.c-sharpcorner.com/article/hashing-passwords-in-net-core-with-tips/

http://www.c-sharpcorner.com/UploadFile/145c93/save-password-using-salted-hashing/

ASP.NET Web Security: Protect User Passwords with Hashing and Salt - Unit Test

using System;
using System.Data.SqlClient;
using System.Security.Cryptography;
using System.Text;

namespace ConsoleApp1
{
internal class Utils
{
public static Boolean ValidatePassword(String enteredPassword, String storedHash, String storedSalt)
{
// Consider this function as an internal function where parameters like
// storedHash and storedSalt are read from the database and then passed.

var hash = HashPassword(enteredPassword, storedSalt);
return String.Equals(storedHash, hash);
}

public static String HashPassword(String password, String salt)
{
var combinedPassword = String.Concat(password, salt);
var sha256 = new SHA256Managed();
var bytes = Encoding.UTF8.GetBytes(combinedPassword);
var hash = sha256.ComputeHash(bytes);
return Convert.ToBase64String(hash);
}

public static String GetRandomSalt(Int32 size = 12)
{
var random = new RNGCryptoServiceProvider();
var salt = new Byte[size];
random.GetBytes(salt);
return Convert.ToBase64String(salt);
}
}

internal class Program
{
private static void Main(string[] args)
{
var defaultAccountLockoutTimeSpan = TimeSpan.FromMinutes(15);
var lockoutEndDate = new DateTimeOffset(DateTime.Now + defaultAccountLockoutTimeSpan);

Console.WriteLine(lockoutEndDate);

const string email = "manhnv8383@gmail.com";
const string password = "Abc@123";

var salt = Utils.GetRandomSalt();

var passwordHash = Utils.HashPassword(password, salt);

using (var conn = new SqlConnection("Server=192.168.2.26;Database=IdentityServerDb;user id=sa;password=123456;"))
{
const string newUserSql = "INSERT INTO \"AspNetUsers\" (\"Id\", \"AccessFailedCount\", \"ConcurrencyStamp\", \"Email\", \"EmailConfirmed\", \"LockoutEnabled\", \"LockoutEnd\", \"NormalizedEmail\", \"NormalizedUserName\", \"PasswordHash\", \"PhoneNumber\", \"PhoneNumberConfirmed\", \"SecurityStamp\", \"TwoFactorEnabled\", \"UserName\") VALUES (@p0, @p1, @p2, @p3, @p4, @p5, @p6, @p7, @p8, @p9, @p10, @p11, @p12, @p13, @p14);";

using (var insertCommand = new SqlCommand(newUserSql, conn))
{
insertCommand.Parameters.AddWithValue("@p0", Guid.NewGuid()); //Id
insertCommand.Parameters.AddWithValue("@p1", 0); //AccessFailedCount
insertCommand.Parameters.AddWithValue("@p2", Guid.NewGuid()); //ConcurrencyStamp
insertCommand.Parameters.AddWithValue("@p3", email); //Email
insertCommand.Parameters.AddWithValue("@p4", 0); //EmailConfirmed
insertCommand.Parameters.AddWithValue("@p5", 0); //LockoutEnabled
insertCommand.Parameters.AddWithValue("@p6", lockoutEndDate); //LockoutEnd
insertCommand.Parameters.AddWithValue("@p7", email.ToUpper()); //NormalizedEmail
insertCommand.Parameters.AddWithValue("@p8", email.ToUpper()); //NormalizedUserName
insertCommand.Parameters.AddWithValue("@p9", passwordHash); //PasswordHash
insertCommand.Parameters.AddWithValue("@p10", DBNull.Value); //PhoneNumber
insertCommand.Parameters.AddWithValue("@p11", 0); //PhoneNumberConfirmed
insertCommand.Parameters.AddWithValue("@p12", Guid.NewGuid()); //SecurityStamp
insertCommand.Parameters.AddWithValue("@p13", 0); //TwoFactorEnabled
insertCommand.Parameters.AddWithValue("@p14", email); //UserName

conn.Open();

insertCommand.ExecuteNonQuery();
}
}
}
}
}

 

Cấu hình IIS cho ứng dụng ASP.NET

June 28, 2017 22:01

Bước 01: Vào Start / Control Panel

Bước 02: Chọn Program and Features

Bước 03: Chọn Turn Windows features on or off , Chọn IIS (Internet Information Services) và chờ trong giây lát để Windows cài đặt dịch vụ

Bước 04: Đăng ký asp.net vào hệ thống với mã lệnh “aspnet_regiis –i” với quyền Administrator



Bước 05: Mở IIS bằng cách vào Start / Control Panel / Administrative Tools / chọn dịch vụ Internet Information Services (IIS) Manager

Bước 06: Tạo Application Pools phù hợp với .NET Framework v4.0.30319

Bước 07: Tạo Application để trỏ tới website ASPNET. Lưu ý: Website đã được Publish thành tập tin .DLL



Bước 08: Chạy website từ trình duyệt với 2 cách: thông qua IIS, thông qua trình duyệt Friefox, Google Chrome, …

Chúc bạn học tập tốt.

Categories

Recent posts