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
| public static class ModelBuilderExtensions | |
| { | |
| //Only add the IEntityTypeConfigurations that are in the DataContext | |
| public static void ApplyConfigurationsForEntitiesInContext(this ModelBuilder modelBuilder) | |
| { | |
| var types = modelBuilder.Model.GetEntityTypes().Select(t => t.ClrType).ToHashSet(); | |
| modelBuilder.ApplyConfigurationsFromAssembly( | |
| Assembly.GetExecutingAssembly(), | |
| t => t.GetInterfaces() |
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 Microsoft.Extensions.DependencyInjection; | |
| using Microsoft.Extensions.Logging; | |
| using System; | |
| namespace Songhay.HelloWorlds.Shell | |
| { | |
| class Program | |
| { | |
| static void Main(string[] args) | |
| { |
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 BigNumber, | |
| isNumeric = /^-?(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i, | |
| mathceil = Math.ceil, | |
| mathfloor = Math.floor, | |
| notBool = ' not a boolean or binary digit', | |
| roundingMode = 'rounding mode', | |
| tooManyDigits = 'number type has more than 15 significant digits', | |
| ALPHABET = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ$_', | |
| BASE = 1e14, | |
| LOG_BASE = 14, |
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; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Threading; | |
| namespace Threading | |
| { | |
| class Program |
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.Threading; | |
| namespace MutexDemo | |
| { | |
| class Program | |
| { | |
| public static Semaphore semaphore = new Semaphore(2, 3); | |
| static void Main(string[] args) | |
| { |
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; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Threading; | |
| namespace Threading | |
| { | |
| class Program |
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; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Threading; | |
| namespace Threading | |
| { | |
| class Program |
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; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Threading; | |
| namespace Threading | |
| { | |
| class Program |
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; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| namespace PermutationsUnqiue | |
| { | |
| class Program | |
| { |
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
| static void SwapWords(List<string> sentence, int i, List<List<string>> results) | |
| { | |
| List<List<string>> combo = new List<List<string>>(); | |
| if (i < sentence.Count && map.ContainsKey(sentence[i])) { | |
| foreach (string s in map[sentence[i]]) { | |
| List<string> temp = new List<string>(sentence); | |
| temp[i] = s; | |
| combo.Add(temp); | |
| } | |
| foreach (List<string> ls in combo) { |
NewerOlder