Category Archives: Uncategorized

Dependency Injection Options

Transient Shortest lifespan : An instance will be created every time one is requested. Each request an instance of given class,the framework will give them each their own instance and not share anything between them   Scoped A single instance will be created for each “scope”.In ASP.NET Core MVC,the “scope” is almost always the current… Read More »

Trust the ASP.NET Core HTTPS development certificate on macOS

Installing the .NET Core SDK installs the ASP.NET Core HTTPS development certificate to the local user certificate store. The certificate has been installed, but it’s not trusted. To trust the certificate perform the one-time step to run the dotnet dev-certs tool: console dotnet dev-certs https –trust

Some Useful Patterns for Web Sites and WebJobs

USEFUL FOR WEBSITES AND WEBJOBS ■ Static Content Hosting pattern ■ Cache-Aside pattern ■ Health Endpoint Monitoring pattern ■ Compensating Transaction pattern ■ Command and Query Responsibility Segregation pattern USEFUL FOR WEBJOBS ■ Competing Consumers pattern ■ Priority Queue pattern ■ Queue-Based Load Leveling pattern ■ Leader Election pattern ■ Scheduler Agent Supervisor pattern

A brief look at Document Db

What is a Document Database? A document database,also called a document store or document-oriented database,is a subset of a type of NoSQL database.Some documents stores ma also be key-value databases(Like Redis).A document database is used for storing,retrieving,and managing semi-structured data.Unlike traditional databases,the data model in a document database is not structured in a table format… Read More »

Creating Custom Media Format with ASP.NET Web API

We can create our own media formats in the ASP.NET Web API project First of all, as root you create a folder called Formatters And we create a class in this folder for the format we want to define(For example for csv format)   using System.Web.Http; using System.Web.Mvc; using Kartal.Formatters; public class DemoItemCsvFormatter : BufferedMediaTypeFormatter… Read More »

Automatically validate antiforgery tokens for unsafe HTTP methods only

ASP.NET Core apps don’t generate antiforgery tokens for safe HTTP methods (GET, HEAD, OPTIONS, and TRACE). Instead of broadly applying the ValidateAntiForgeryToken attribute and then overriding it with IgnoreAntiforgeryToken attributes, the AutoValidateAntiforgeryToken attribute can be used. This attribute works identically to the ValidateAntiForgeryToken attribute, except that it doesn’t require tokens for requests made using the following HTTP methods: GET HEAD OPTIONS TRACE Recommended… Read More »

Abstract Classes vs Interfaces

​Both of them are incomplete you can not create an instance Basic Differences ​Can have implementations for some of its members(methods) ​Can not have implementation for any its members ​Can have fields ​Can not have fields ​Member is private by default and can have access modifiers ​Members are public by default but they can not… Read More »

What is GAC?

​GAC (Global Assembly Cache) GAC contains strong named assemblies. Assemblies in the GAC can be shared by all applications running on that machine, without having to copy the assembly local It is recommended to install an assembly into GAC,only when required and shared by applications, otherwise they should be kept private Advantages of using GAC:… Read More »

SOAP vs REST

  What is SOAP(Simple Object Access Protocol) -Is an xml based messaging protocol using by web services -Is a format for sending and receiving messages -Is platform independent -Is based on XML -Is a W3C recommendation -Language,Platform & Transport Independent,Distributed Enterprise -Environments,Standardized,Pre-build extensibility -Built in error handling -Automation -Soap overhead,schema confirmation(xsd,wsdl),ws standards,xml -Main advantage of… Read More »