This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using System.IO; | |
| using System.Collections.Generic; | |
| using System.Runtime.Serialization.Formatters.Binary; | |
| using System.Linq; | |
| namespace Vasconcellos.Extensions | |
| { | |
| public static class ObjectExtension | |
| { | |
| /// <summary> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using System.Threading.Tasks; | |
| using MongoDB.Bson; | |
| using MongoDB.Bson.Serialization; | |
| using MongoDB.Bson.Serialization.Serializers; | |
| using MongoDB.Driver; | |
| namespace VS.Services | |
| { | |
| public class MongoDBService | |
| { | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using Polly; | |
| using RestSharp; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Net; | |
| using System.Text.Encodings.Web; | |
| using System.Text.Json; | |
| using System.Threading.Tasks; | |
| namespace RestSharpWithPolly | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| /// <summary> | |
| /// Response Model | |
| /// </summary> | |
| public class ResponseModel<T> | |
| { | |
| /// <summary> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | void Main() | |
| { | |
| var x = 19; | |
| var y = 7; | |
| Console.WriteLine($"Factorial of x={x}, result={Factorial(x)}.\n"); | |
| Console.WriteLine($"Multiplication of x*y={x}*{y}={Multiplication(x, y)}.\n"); | |
| Console.WriteLine($"Binary of x={x}, result={DecimalToBinary(x)}.\n"); | |
| } | |
| public long Factorial(long x) | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var url = 'https://udemy.com.br/OpenClass'; | |
| var obj = { schoolID: 77 , classId: 3}; | |
| var callBackParameter = {}; | |
| var callBackFunction = function(ajax, callBackParameter) { | |
| let objResponse = JSON.parse(ajax.responseText); | |
| console.log('Response Object', objResponse); | |
| }; | |
| var callBackErrorParamater = {}; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | var schoolID = 77; | |
| var classId = 3; | |
| var url = 'https://udemy.com.br/Cursos?schoolID='+schoolID+'&classId='+classId; | |
| var callBackParameter = {}; | |
| var callBackFunction = function(callBackParameter, ajax){ | |
| let objResponse = JSON.parse(ajax.responseText); | |
| console.log('Response Object', objResponse); | |
| }; | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | <?php | |
| if(empty($_SERVER['HTTPS']) || $_SERVER['HTTPS'] == "off"){ | |
| $redirect = 'https://' . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI']; | |
| header('HTTP/1.1 301 Moved Permanently'); | |
| header('Location: ' . $redirect); | |
| exit(); | |
| } | |
| ?> | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | --SQL to close all connections and drop database | |
| USE [master]; | |
| DECLARE @DatabaseName VARCHAR(MAX) = 'MyDatabaseName' --to change | |
| DECLARE @kill VARCHAR(8000) = ''; | |
| SELECT @kill = @kill + 'kill ' + CONVERT(VARCHAR(5), session_id) + ';' | |
| FROM sys.dm_exec_sessions | |
| WHERE database_id = db_id(@DatabaseName) | |
| EXEC(@kill); | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | using AutoMapper; | |
| using Vasconcellos.WebAPI.Entity; | |
| using Vasconcellos.WebAPI.Model; | |
| using Microsoft.AspNetCore.Http; | |
| using Microsoft.AspNetCore.Mvc; | |
| using Microsoft.EntityFrameworkCore; | |
| using Microsoft.Extensions.Logging; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; |