Skip to content

Instantly share code, notes, and snippets.

View ankitkanojia's full-sized avatar
🤠
Adept Coder - Full Stack Developer

Ankit Kanojia ankitkanojia

🤠
Adept Coder - Full Stack Developer
View GitHub Profile
@ankitkanojia
ankitkanojia / helper.cs
Created September 2, 2019 05:50
Copy property function to copy all properties from one object to another using reflection
// Common function which is use to copy or make a clone of one object to another with datatype and value
public static void CopyProperties<TSelf, TSource>(this TSelf self, TSource source)
{
try
{
var sourceAllProperties = source.GetType().GetProperties();
foreach (var sourceProperty in sourceAllProperties)
{
var selfProperty = self.GetType().GetProperty(sourceProperty.Name);
@ankitkanojia
ankitkanojia / sample.js
Last active September 2, 2019 07:08
Javascript or Jquery loop iterations, Different type of loop iterations.
var arrayCollection = [“ABC”, “DEF”, “HIJ”];
$.each(arrayCollection, function(index, value){
console.log(“index : ,index, value :, value);
});
$(arrayCollection).each(function(index, value){
console.log(“index : ,index, value :, value);
});