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
CREATE PROCEDURE [dbo].[UserAccount_Create] | |
( | |
@Name varchar(10) | |
, @FullName varchar(100) | |
, @LoginTitle varchar(100) = null | |
, @LoginMessage varchar(2000) = null | |
, @WelcomeMessage varchar(8000) = null | |
, @Domain varchar(100) = null | |
, @RegionId int = null | |
, @ExternalRef varchar(50) = 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 TResult With<TInput, TResult>(this TInput o, | |
Func<TInput, TResult> evaluator) | |
where TResult : class | |
where TInput : class | |
{ | |
if (o == null) return null; | |
return evaluator(o); | |
} | |
public static TResult Return<TInput, TResult>(this TInput o, |
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
SELECT * FROM information_schema.tables | |
select * from information_schema.columns where table_name = [table name] |
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.Select(c => new SelectListItem { Value = c.Id, Text = c.Name }) | |
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) | |
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
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
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
# 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
public static class DateTimeExtensions | |
{ | |
public static String GetTimestamp(this DateTime value) | |
{ | |
return value.ToString("yyyyMMddHHmmssffff"); | |
} | |
} |