This file contains 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
<#@ template language="C#" debug="false" hostspecific="true"#> | |
<#@ include file="EF6.Utility.CS.ttinclude"#><#@ | |
output extension=".cs"#><# | |
const string inputFile = @"WBS.edmx"; | |
var textTransform = DynamicTextTransformation.Create(this); | |
var code = new CodeGenerationTools(this); | |
var ef = new MetadataTools(this); | |
var typeMapper = new TypeMapper(code, ef, textTransform.Errors); | |
var fileManager = EntityFrameworkTemplateFileManager.Create(this); |
This file contains 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
/* | |
Here’s a neat nuget for packing lists of checkboxes based on a MVC model. Currently implementing this for activities on the signup form. | |
http://www.codeproject.com/Tips/613785/How-to-Use-CheckBoxListFor-With-ASP-NET-MVC | |
note, as shown below, you do actually need to get the list of available ones twice. | |
There is also relatively new to .net html.enumdropdownlist for. I think I will implement this for the gender selection. | |
https://msdn.microsoft.com/en-us/library/system.web.mvc.html.selectextensions.enumdropdownlistfor(v=vs.118).aspx | |
*/ |
This file contains 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 Microsoft.VisualStudio.TestTools.UnitTesting; | |
//http://stackoverflow.com/questions/23530982/c-sharp-asserting-two-objects-are-equal-in-unit-tests | |
namespace Tests.Helpers | |
{ | |
public class AssertHelper | |
{ | |
public static void HasEqualFieldValues<T>(T expected, T actual) |
This file contains 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.Linq; | |
using System.Security.Claims; | |
using Newtonsoft.Json; | |
namespace Account | |
{ | |
public static class ClaimsExtensions | |
{ | |
public static string Get(this ClaimsIdentity identity, string type) | |
{ |
This file contains 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 DataTableHelpers | |
{ | |
public static IEnumerable<T> To<T>(this DataTable data) | |
{ | |
Mapper.Initialize(cfg => | |
{ | |
MapperRegistry.Mappers.Add(new AutoMapper.Data.DataReaderMapper { YieldReturnEnabled = true }); | |
}); | |
Mapper.CreateMap<IDataReader, T>(); |
This file contains 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
/// C# Naming Conventions | |
/// References | |
/// Source https://social.msdn.microsoft.com/Forums/vstudio/en-US/6226f8bb-d00b-4cd5-abf5-3a1263e6f62f/c-boolean-naming-conventions?forum=csharpgeneral | |
/// Author https://social.msdn.microsoft.com/profile/eyal-shilony/?ws=usercard-mini | |
/// Pascal Case - Capitalized the first letter for each word in the context e.g. HelloWorld. | |
/// Camel Case - Capitalized the first letter for each word in the context except the first word e.g. helloWorld. | |
/// Use uppercase notation when you have to deal with acronyms e.g. IP, UI. |
This file contains 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.Diagnostics; | |
using ServiceStack.OrmLite; | |
using System.Collections.Generic; | |
using System.Reflection; | |
using System.Linq; | |
namespace Database.Copy | |
{ | |
class Program |
This file contains 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.Data; | |
using System.Data.Common; | |
using System.Globalization; | |
using System.Linq; | |
using System.Text; | |
using System.Text.RegularExpressions; | |
namespace Database.Copy |
This file contains 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.Configuration; | |
using Newtonsoft.Json.Linq; | |
using System.IO; | |
using System.Linq; | |
namespace ExampleProject | |
{ | |
public class AmazonConfigurationProvider : ConfigurationProvider | |
{ | |
private const string ConfigurationFilename = @"C:\Program Files\Amazon\ElasticBeanstalk\config\containerconfiguration"; |
This file contains 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
{ | |
"manifestVersion": 1, | |
"deployments": { | |
"aspNetCoreWeb": [ | |
{ | |
"name": "app", | |
"parameters": { | |
"appBundle": ".", | |
"iisPath": "/", |
OlderNewer