C# Corner

Resources  
  • LINQ Fundamentals - Single() Vs SingleOrDefault() - Part TwoApr 05, 2018. In first part we discussed First() and FirstOrDefault() extension method, In this part we will discuss Single() and SingleOrDefault().
  • Basics Of Node.js ModulesApr 02, 2018. Nowadays, Most of the web developers are working with new technology like Angular, React, Vuejs a frontend and Express.Js, Meteor web framework or SharePoint Framework of the JavaScript. But every developer face issue to understand the pattern of writing the code or we can say the ecosystem used in the packages\libraries.
  • Learn About Azure Data FactoryApr 02, 2018. Azure Data Factory is a cloud-based data integration service that allows you to create data-driven workflows in the cloud for orchestrating and automating data movement and data transformation.
  • Separation Of Concern And Data Access From Within CodeMar 24, 2018. In this article, you will learn the separation of concern and data access from within code.
  • Create A New Application In DotVVMMar 23, 2018. In this article, we will learn the step-by-step method to create your first DotVVM application in .NET Core.
  • Android Kotlin - Strings And Ranges - Part ThreeMar 20, 2018. In this article, we are going to learn about Strings and Ranges in Kotlin with string methods.
  • Setting Up Entity Framework Core Database With FactoryMar 14, 2018. In this write-up, I will explain how to easily and quickly set up your database using Entity Framework Core in a .NETCore project using the factory pattern to connect your entities to your database.
  • Implementing Multiple Interfaces With The Same Method Signature In C#Mar 14, 2018. An interface in C# is a type which only defines a group of related functionalities and leaves the implementation of the functionalities to any class or struct which implements the interface. It helps a lot in implementing the SOLID principles and makes the application more decoupled.
  • Understanding Method Overriding And Virtual, Override And New Keywords In C#Mar 06, 2018. Use of inheritance and polymorphism has become an integral part of our life as a programmer. Inheritance provides a lot of benefits including code reusability, separation of concerns, cleaner code, extensibility etc.
  • Entity Framework Core Feature - Global Query FiltersMar 02, 2018. This feature is also refer as Model-level query filters. It allows to specify filter in the model level that are automatically applied to all queries that executed on the context on the specified type. It means that entity framework automatically adds the filter in where clause before executing the LINQ queries. Usually Global query filters are applied in OnModelCreating method of context. This filters are also automatically applied to LINQ queries involving the entity types referenced indirectly like included as navigation property.
  • No Tracking With Entity Framework CoreMar 02, 2018. DbContext in Entity Framework is responsible for tracking the changes made on the entity or object, so the correct update is done to the database when the SaveChange() method of context is called. When we retrieve entities using an object query, the Entity Framework puts these entities in a cache and tracks whatever changes are made on these entities until the savechanges method is called. Entity Framework tracks the query results that return entity types.
  • How To Fetch Data From Task List Using Rest For Workflow History In SharePoint OnlineFeb 20, 2018. I got a requirement to make a history form for a workflow. For that, I had to fetch the data from a task list. We can use Rest API, SP Services, or any other methods for this kind of task. So, I chose REST API for the same. Now, the question is, what will be the scenario? Because Workflow status columns of Assign to and Modified Date are not available in the normal list. Then, I learned that we can fetch it from the task list or history list as in workflow all the information resides in Task list & History List.
  • Design Patterns Simplified - StrategyFeb 13, 2018. This article explains what Strategy Design Pattern is and how to use it in software design and development.
  • Properties Of Object.prototype In JavaScriptFeb 05, 2018. Object.prototype is used to inherit properties and methods to the Constructor method, it may be overridden. We can use any constructor to create the object of another type with the help of Object.create() method and assign to the new constructor prototype.
  • CRUD Operations In ASP.NET Core 2 Razor Page With Dapper And Repository PatternFeb 04, 2018. This article will demonstrate how to perform CRUD operations in Razor Page which were introduced with Asp.Net Core 2 using Dapper and Repository Pattern.
  • Client Side Development With SharePoint Using NodeJS And PnPJan 30, 2018. Nowadays, client side development with SharePoint is growing bigger and bigger with lot of APIs emerging against SharePoint data. @PnP (PnPJS) is a new javascript API from SharePoint Patterns and Practices team.
  • Overview Of Strategy Design PatternJan 23, 2018. In this article, we will learn about Strategy Design Pattern.
  • Abstract Factory Pattern Using C# - Real World ExampleJan 22, 2018. While learning design patterns, I came to understand the most frequently used term, Factory Pattern as well as Abstract factory pattern. I searched the internet and came across numerous learning points. After a lot of search and study, I endeavored to find an actual need for the abstract design pattern.
  • Design Patterns Simplified - Chain Of ResponsibilityJan 22, 2018. This article explains what Chain of Responsibility Design Pattern is and how to use it in software development.
  • Cab Booking And Scheduling By Using Command Design Pattern And SchedulerJan 20, 2018. This article explains the cab booking & scheduling system by using Command Design Pattern and Scheduler.
  • Expression Bodied Members In C#Jan 18, 2018. What is Expression Bodied Members?1) Expression Bodied member is introduced in C#6.0 and enhanced in C#7.0. 2) Expression Bodied is a new technique or implementation to make code concise and readable. 3) Expression Bodied makes the type member(Constructor, Destructor, Methods, Property, Indexer) defined in a single expression. 4) Expression Bodied members can only be applied to the below list of type members: Constructor introduced in C#7.0 Destructor introduced in C#7.0 Property get accessor introduced in C#6.0 Property set accessor introduced in C#7.0 Methods introduced in C#6.0 Indexer introduced in C#7.0 The Syntax of expression body definition is:member => expression; where expression should be a valid expression and member can be any from above list of type members.Suppose we have a method or constructor that contain a single expression or line of code. Then In spite of using the traditional way to write code inside a method or constructor code block, we can write them as a single syntax. Those members who can follow this approach is known as Expression Bodied Members.
  • Railway Ticket Fare Calculation With Strategy PatternJan 15, 2018. This article explains how to calculate Railway ticket fare by using Strategy Design Pattern.
  • C# 7.2 - "In" Parameter Method Overloading TiebreakerJan 14, 2018. This article explains the “in” parameter method overloading with Visual Studio 2017 Version 15.6. Preview 2.
  • Singleton Design Pattern In C# - Part Three (Static vs Singleton)Jan 11, 2018. In this series of learning singleton patterns, we learned lazy initialization and eager initializations with practical examples. We also learned why it is necessary to make the singleton class sealed with sealed keyword. In this article, I’ll try to explain the differences between static and singleton class and where to use static and where to use singleton classes.
  • Singleton Design Pattern In C# - Part Two (Eager and Lazy Initialization in Singleton)Jan 09, 2018. In this article, we’ll discuss Lazy initialization, the lazy keyword, why to make singleton class a sealed class and what are the differences between singleton and static class.
  • Singleton Design Pattern In C# - Part OneJan 08, 2018. I always wanted to write about Singleton design pattern in C#. Though there already are many posts available on Singleton design pattern, I’ll try to cover this topic in the most simplistic and easy to understand way.
  • Share Code Between ASP.NET Core MicroServicesJan 04, 2018. Microservice architecture or microservices is a method of developing software applications as a suite of independently deployable, small, modular services in which each service runs a unique process and communicates through a well-defined, lightweight mechanism to serve a business goal.
  • Repository Pattern In ASP.NET MVCJan 02, 2018. In this article, we will learn about Repository pattern which is mostly used to create enterprise applications. Repository pattern divides application’s UI, business logic and data access components into different layers that are easily maintainable and testable.
  • Consuming ASP.NET Core 2.0 Web API Using HttpClientDec 26, 2017. We’ll create a library to wrap the functionality of HttpClient. I’ll use builder pattern for this purpose. Add a class with methods for storing parts of HttpClient.
  • Some Useful JavaScript Methods, Variable And Objects In Sharepoint 2013Dec 21, 2017. In my previous blog, I explored _spPageContextInfo variable properties. This time, I am exploring some SharePoint-provided useful methods and objects in JavaScript.
  • Configure Identity In ASP.NET Core 2.xDec 15, 2017. Identity is a membership system that allows us to add login functionality to our application. In my previous article, I have explained about the overview of Identity in ASP.net Core. There are some default behaviors that can be overridden easily in our application in ConfigureService method of startup class.
  • Swift Programming - Zero To Hero - Part NineDec 13, 2017. In this article, I have shared some details about Design Patterns in Swift Programming.
  • Knowing When To Reflect With Caller Info AttributesDec 10, 2017. If you've been around C# long enough, you've probably had a need at one time or another to figure out some information about code that's being executed. It might be a method name, the file being executed, or even more specific details like the line number.
  • Understanding Classes In KotlinDec 07, 2017. In the above example, I have created a nested class ‘Nestedclass’ which has a data member ‘b’ and a member method show(),now the object of nested class can access member of nested class only.
  • Dynamic Search In DataGridViewNov 30, 2017. This article will help you to understand the Dynamic Search method in DataGridView in C#.
  • Passing Data Between Components - Day TwoNov 29, 2017. We have seen that we can pass the data between the components using the @Input and @Output directives and using event emitters. Let’s see the other two methods - @View child and the services which can be used to pass the data between components.
  • Building Entity Framework Disconnected Generic RepositoryNov 29, 2017. The repository pattern separates and retrieves data model mapping logic from the business logic. We will create a repository class for each entity class in our application. All these classes usually have a main group of equals methods.
  • Passing Data Between ComponentsNov 28, 2017. Article explains 2 Methods of communication between the components .
  • Generate Python Wrapper For C# Methods Using ReflectionNov 27, 2017. In this article, we will generate a Python wrapper around C# methods using reflection methods of .NET framework.
  • Implementing Field Mapping Using Xrm.WebApiNov 24, 2017. In this article, we are going to provide sample code for using Xrm.WebApi retrieve method.
  • Using Xrm.WebAPI In Dynamics 365/CRMNov 22, 2017. With the release of Dynamics 365 update 9.0, now we have a new library to implement WebApi methods using Xrm.WebApi. Instead of writing complete request, now we can just use direct CURD methods from WebApi.
  • Your Singleton Might Not Be "Single"Nov 21, 2017. Singleton has been a very popular design pattern as it is proven to have some advantages compared to the global variables
  • Dynamic Filter By Using Intercepting Filter PatternNov 19, 2017. This article explains Dynamic Filter using Intercepting Filter Pattern
  • Create App Using Xamarin.Android Using C# - Part FourNov 17, 2017. Xamarin.Android has native user interface controls. These controls can be easily added to Xamarin.Android apps using the Android Designer or programatically via XML layout files. Xamarin.Android exposes all of the user interface object properties and methods in C#.
  • Passing Parameters To Middleware In ASP.NET Core 2.0Nov 15, 2017. I discussed in an earlier post that it is good practice to define middleware in a separate class and add to the pipeline using extension methods. We may also need to pass information to our middleware classes though and I’ve come across two patterns for this when digging into ASP.NET Core source code and other samples online.
  • What Is Struct And When To Use Struct In C#Nov 15, 2017. 'Struct' keyword is used to create a structure. A structure can contain variables, methods, static constructor, parameterized constructor, operators, indexers, events, and property. A structure can not derive/inherit from any structure or class. A structure can implement any number of interfaces. Structures provide better performance.
  • Azure Table Storage In ASP.NET Core 2.0Nov 14, 2017. Add a class to encapsulate storage access. Add a private helper method to access storage
  • ASP.NET Core 2.0 MVC FiltersNov 13, 2017. Filter runs after an action method has been selected to execute. MVC provides built-in filters for things like authorization and caching. Custom filters are very useful to encapsulate reusable code that you want to run before or after action methods.
  • Introduction To Bot Service In AzureNov 10, 2017. Bot used as an app that helps users interact in a conventional way. It may be as simple as basic pattern matching with a response or it may be sophisticated handling the artificial techniques with complex conversational state and integration to existing business services.
  • Azure Data Factory - ETL Solution To Azure DB And To Azure SQL Data WarehouseNov 09, 2017. In this article we will learn how to use Azure Data Factory to Extract, Transform, Load (ETL) data especially for the data warehousing purposes.
  • Debugging Tips - Part ThreeNov 06, 2017. While working on a complex code, we often come across situations where you need to debug lots of code to find/fix the issue(s). That also includes going through lots of methods (probably related or unrelated). .NetFramework provides a way to avoid unwanted "Step in" through the methods. Using DebuggerStepThrough (using System.Diagnostics) attribute, you can skip debugging of unwanted methods and reduce the debugging time to some extent.
  • Binding DropDown List Using Tuple In ASP MVCNov 05, 2017. Tuple is a generic static class that was added to C# 4.0 and it can hold any amount of elements, and they can be any type we want. So using tuple, we can return multiple values.One great use of tuple might be returning multiple values from a method. It provides an alternative to "ref" or "out" if you have a method that needs to return multiple new objects as part of its response.
  • Introduction To ASP.NET MVC Model BindingNov 02, 2017. Asp.NET MVC model binder allow you to map http request data with model. HttpRequest data means when user makes a request with form data from browser to controller at that time model binder works as middle man to map the incoming http request with controller action method.
  • ASP.NET Core 2.0 MVC RoutingOct 23, 2017. Routing in ASP.NET Core MVC is the mechanism through which incoming requests are mapped to controllers and their actions. This is achieved by adding Routing middleware to the pipeline and using IRouteBuilder to map URL pattern (template) to a controller and action.
  • Hosting Website With Filezilla To AzureOct 19, 2017. We can use the FTP client Filezilla for website hosting to Azure. And it is an FTP method. And sometimes we may face some errors in it. And the solution is also mentioned in this article.
  • Power BI - Get Data From SharePoint List / LibraryOct 16, 2017. In this article, we will explore two methods to get data from SharePoint List / Library in Power BI.
  • C# 7.0 And C# 7.1 New Features - Part TwoOct 16, 2017. This article explains the new features of C# 7.0 & C#7.1. It covers new features like Discards, Pattern Matching, Generalized async return types, Async Main (Main Method returning Task), Infer Tuple Element Names, Default Literal Expressions & Type Inference and Pattern Matching with Generics.
  • Angular Components (With Examples)Oct 12, 2017. A Component is nothing but a simple typescript class, where you can create your own methods and properties as per your requirement which is used to bind with an UI (html or cshtml page) of our application.
  • How To Use Fiddler With ASP.NET Web API TestingOct 11, 2017. If you are developer, tester or a manager, sometimes understanding the various methods of API can be a challenge when building and consuming the application.
  • Understanding Service, Factory, And ProviderOct 09, 2017. In this section, we will endeavor to comprehend the most frequently confounding elements and usefulness of AngularJS Service, Factory and Provider.
  • ASP.NET Core 2.0 Session StateOct 09, 2017. Using an empty project from a previous post, amend Startup class ConfigureServicee() method, and add services for session and its backing store.
  • How To Use Postman With ASP.NET Core Web API TestingOct 04, 2017. If you are developer, tester, or a manager, sometimes understanding the various methods of API can be a challenge when building and consuming the application.
  • Why "Service Locator" is an "Anti-Pattern" for Dependency InjectionSep 29, 2017. The Service Locator is used as a replacement for the new operator. The problem with service pattern is that it hides a class's dependencies and is a bonafide anti-pattern. In fact, it takes away a developer's clarity about the class he/she is using.
  • ASP.NET Core 2.0 Error PagesSep 29, 2017. Starting from an empty project, created in a previous post, amend the Configure() method of Startup class to use middleware needed for error handling. Below I’ve used a custom middleware (defined as lambda) to handle production exceptions.
  • Create Value Object In C#Sep 28, 2017. Create a class that abstracts away (encapsulate) ‘data’ in your domain and provide methods to work on it. Below is a class I don’t consider a good Value Object.
  • Builder Pattern In C#Sep 26, 2017. In this article, we will learn about Builder Pattern in C#.
  • How To Use Swagger With ASP.NET Core Web APIsSep 24, 2017. If you are developer, tester or a manager, sometimes understanding the various methods of API can be a challenge when building and consuming the application.
  • Dependency Injection - Part 7 - Service Locator PatternSep 18, 2017. Service locator pattern is one of the most commonly used patterns. In general, this pattern is used along with other patterns like Adapter Pattern, Observer Pattern, Dependency Injection Principles and many more. In this post, however, we will be talking about its use with dependency injection, which is one its many uses.
  • Create Immutable Type In C#Sep 14, 2017. A public constructor that accepts initialization data is required so that the client can pass-in minimum state for the type to be valid. Private constructor, on the other hand, is used by methods to construct a new object and set its entire state.
  • ASP.NET Core 2.0 EnvironmentsSep 12, 2017. Starting from an empty project, discussed in a previous post, modify the Configure() method to use the IHostingEnvironment to call different middleware based on current environment.
  • Frequent Pattern And Market Basket ImplementationSep 09, 2017. Frequent pattern mining is about the item sets and sequences which appear in a data set.
  • How Should We Store Images And Blob Files In SQL ServerSep 06, 2017. There is always a requirement from developers: How should I store images and BLOB files in SQL Server ? In this post let's explore the data types and methods used for storing Binary Large Objects also know as BLOBs, such as images and sounds, into SQL Server.
  • Getting Started With Bing Speech API In WPF ApplicationsSep 06, 2017. Cognitive services are a set of APIs that are designed to democratize artificial intelligence by enabling systems to see, hear, speak, understand and interpret our needs using natural methods of communication.
  • ASP.NET Core 2.0 MiddlewareSep 06, 2017. Create a Hello World app using ASP.NET Core Middleware. Middleware components are called in the order they appear in Configure() method; i.e., the order in which they're added to the pipeline. The response, on its way back to the client, also passes through the same middleware pipeline.
  • Getting Started With Voice Of The CustomerAug 29, 2017. In any industry customer satisfaction plays a very important role. It provides a real picture about our happy and unhappy customers which helps us to manage and plan our business effectively. We can get a customer satisfaction matrix using different methods and one of them is to use customer satisfaction surveys.
  • Creating Login Form For Users With Image Uploading For Password RecallAug 27, 2017. The article is an alternate method of creating a login form where the conventional way of giving a password hint will be given as a question. In this, you can add an image which can be your hint if you forget your password.
  • Custom Extension Method In C#Aug 23, 2017. Here, I am going to explain how to create and use the extension method.
  • Swift Programming - Zero To Hero - Part ThreeAug 17, 2017. Statements are the building blocks of any program. We can perform any function with the help of statements, such as checking values or declaring variables, calling methods, or even creating objects.
  • Custom Model Binding In ASP.NET Core MVCAug 17, 2017. Model binding in MVC maps HTTP request data to the parameters of the controller's action method. The parameter may either be of simple type like integers, strings, double etc. or complex types. MVC binds the request data to the action parameter by parameter name.
  • Dependency Injection - Part 3 - Implicit Vs Explicit DependenciesAug 12, 2017. If a component or class depends upon other components to complete its operations, then these other components are dependencies for this class. Our class can have these dependencies as implicit or explicit dependencies.
  • CRUD Operation Using Code First Approach, Web API, Repository Pattern, Unit Of Work, And jqGrid In MVCAug 10, 2017. Today, in this article, I will explain how to perform CRUD operations in MVC using Code First Approach.
  • Overview Of Filters In MVC - Part TwoAug 10, 2017. In ASP.NET MVC, a user request is routed to the appropriate Controller and Action Method. We need situations where we want to execute some logic before or after an action method executes. ASP.NET MVC provides Filters for this.
  • Introduction To jQuery And Web API 2 Controller’s Method Relationship Using jQuery AJAX In ASP.NET MVC RazorAug 06, 2017. ASP.NET Web API is a smart framework to build HTTP services which can be consumed by Multi platform clients including desktops or smart phone devices, irrespective of browsers or Operating Systems being used.
  • Overview Of Filters In MVCAug 06, 2017. In ASP.NET MVC, a user request is routed to the appropriate controller and action method. We need situations where you want to execute some logic before or after an action method executes. ASP.NET MVC provides filters for this.
  • Building Your Own Container ImagesAug 04, 2017. Here, we will be building our own container images. For doing this we have two different ways, namely manual method and automated method. Let us see both ways.
  • Null Object Design PatternJul 29, 2017. A null object is also known as a Stub, an Active Nothing or an Active Null. It helps our program logic to get rid of null checks where ever possible. We all know, that we can not call methods on a null reference as it results in a NullReferenceException. The null object pattern provides a non-functional object in place of a null reference and therefore allows methods to be called on it.
  • Component In Angular 2 and How to Create Nested Component in Angular 2Jul 25, 2017. In this article, we will learn about Angular 2 components and we will also see how to create a nested component.
  • Way Of Adding Angular In Visual Studio 2017 With a Simple MethodJul 24, 2017. This article explains how to add Angular in a simple way. We can add AngularJS in a different way to develop an application in Visual Studio but this article explains how to add angularJS in Visual Studio 2017 using a simple method.
  • React Tutorials - Day Six - FluxJul 24, 2017. Flux is a programming architecture and concept where data flows in an unidirectional way. Flux is not a framework or library, it is just an architecture pattern that was developed by Facebook along with the React View library to manage the data flow into our application. Flux makes it easier to track the changes and bugs during development.
  • Working With Filters In ASP.NET Core MVCJul 18, 2017. Filters allow us to run custom code before or after executing the action method. It provides ways to do common repetitive tasks on our action method. The filters are invoked in certain stages in the request processing pipeline.
  • Ability To Develop HTTP Methods Or Verbs (GET, POST, PUT, DELETE etc)Jul 17, 2017. Before going to explain the significant verbs or methods (GET, POST, PUT, DELETE, HEAD, OPTIONS, TRACE and CONNECT) for the communication among different clients and servers, first of all we should understand what HTTP methods are and how they are useful in real time.
  • Arithmetic Operation In ASP.NET MVCJul 16, 2017. In action result method I passed one string parameter named command and using this command I assigned some arithmetic operation string value and based on that the operation will be performed.
  • Introduction To SharePoint Event ReceiversJul 12, 2017. Event Receiver is a important feature in SharePoint . The use of Event Receiver is to handle the events. It is like a method that is triggered when an action occurs on a specified SharePoint object.
  • AddMvc And AddMvcCore Method In ASP.NET Core MVCJul 07, 2017. In this article, you will learn the differences between AddMVC() method and AddMvcCore() in ASP.NETcore MVC. ASP.NET Core is a modular complete rewrite of .NET cross platform framework.
  • Update Entity Form JS Library Without Removing Event Handlers - Quick WorkaroundJul 06, 2017. Let’s say we have one entity with a good amount of custom fields and we have developed a web resource for the main form. Many of the fields have onchange event associated with them. Now we have a new requirement where we need to implement a similar kind of form with some new functionality for different types of users and some of the existing methods also need to be modified. The requirement is to replace new form JS library with updated new JS library but without removing dependent handlers (as we are using many onchange event handlers as it is) with minimum effort.
  • Two-Class Boosted Decision TreeJul 03, 2017. Two-Class Boosted Decision Tree module creates a machine learning model that is based on the boosted decision trees algorithm. A boosted decision tree is an ensemble learning method in which the second tree corrects for the errors of the first tree, the third tree corrects for the errors of the first and second trees, and so forth. Predictions are based on the entire ensemble of trees together that make the prediction.
  • MVVM In WPFJun 29, 2017. MVVM is an architecture pattern which facilitates separation of projects into three logical layers with their own responsibilities. It facilitates modern techniques such as Separation of Concern, Unit testing and TDD. It is set of guidelines, that, when used, makes it easier to develop applications.
  • Building Web Apps With ASP.NET Core And DotVVMJun 29, 2017. There is one category of web applications where the MVVM pattern can be especially useful: line of business applications. Yes, these crazy large web sites with hundreds of grids, large and complicated forms with hundreds of fields, tabs, wizards and modal dialogs.
  • Working With Objects In Windows PowerShellJun 27, 2017. Everything in PowerShell is an Object. An Object is a programmatic representation of anything. Each object has properties and methods.
  • Web API Design Principles Or Web API Design GuidelinesJun 22, 2017. In this article you will learn about Web API Design Principles or Web API Design Guidelines.

About Factory-Method-Pattern

NA
Hire a remote developer
Looking to add more bandwidth to your software team? Web Developers, designers, testers are now available on demand. Flexible hours, very competitive rates, expert team and High Quality work.
X

Build smarter apps with Machine Learning, Bots, Cognitive Services - Start free.

Start Learning Now