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 EnumHelper<T> | |
{ | |
public static string GetEnumDescription(T _enum) | |
{ | |
Type type = _enum.GetType(); | |
var memInfo = type.GetMember(_enum.ToString()); | |
if (memInfo.Length > 0) | |
{ |
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 string GetBuildNumber() | |
{ | |
return Assembly.GetExecutingAssembly().GetName().Version.ToString(); | |
} |
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
icacls app_code /grant "IIS APPPOOL\umbraco":(OI)(CI)RX | |
icacls app_browsers /grant "IIS APPPOOL\umbraco":(OI)(CI)RX | |
icacls app_data /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls bin /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls config /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls css /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls data /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls macroscripts /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls masterpages /grant "IIS APPPOOL\umbraco":(OI)(CI)M | |
icacls media /grant "IIS APPPOOL\umbraco":(OI)(CI)M |
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 SafeExtensions | |
{ | |
public static IEnumerable<T> SafeToList<T>(this IEnumerable<T> source) | |
{ | |
return source != null ? source.ToList() : null; | |
} | |
public static T[] SafeToArray<T>(this IEnumerable<T> source) | |
{ | |
return source != null ? source.ToArray() : null; |
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 DateTimeExtensions | |
{ | |
public static String GetTimestamp(this DateTime value) | |
{ | |
return value.ToString("yyyyMMddHHmmssffff"); | |
} | |
} |
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
# Simple environment setup script | |
# Install Applications | |
choco install fiddler4 | |
choco install notepadplusplus | |
choco install visualstudiocode | |
choco install greenshot | |
choco install GoogleChrome | |
choco install putty | |
choco install ccleaner |
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
string res = ""; | |
var displayOrder = new Dictionary<string, int>(){{"string two",2},{"string 1",1},{"string 3",3}}; | |
res = "Person ID" + displayOrder.OrderBy(x => x.Value).Aggregate(res, (current, x) => current + " - " + x.Key); | |
// for demo in LINQPad | |
res.Dump(); |
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
string res = ""; | |
var displayOrder = new Dictionary<string, int>(){{"string 2",2},{"string 1",1},{"string 3",3}}; | |
res= string.Join(" - ",displayOrder.OrderBy(x => x.Value).Select(x=>x.Key)); | |
// dump to LINQPad | |
res.Dump(); |
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
@model UserViewModel | |
@using (Html.BeginForm()) | |
{ | |
<div> | |
@Html.HiddenFor(m => m.Id) | |
@Html.TextBoxFor(m => m.FirstName) | |
@Html.TextBoxFor(m => m.LastName) | |
@Html.DropDownListFor(m => m.CountryId, Model.Countries) | |
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
@model EditUserModel | |
@using (Html.BeginForm()) | |
{ | |
<div> | |
@Html.HiddenFor(m => m.Id) | |
@Html.TextBoxFor(m => m.FirstName) | |
@Html.TextBoxFor(m => m.LastName) | |
@Html.DropDownListFor(m => m.CountryId, Model.Countries) | |
OlderNewer