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
// Get SOAP current request | |
OperationContext.Curent.RequestContext.RequestMessage.ToString(); | |
public class WcfHelper : IDisposable | |
{ | |
private static WcfHelper wcf = new WcfHelper(); | |
private static Dictionary<Type, ChannelFactory> factories = new Dictionary<Type, ChannelFactory>(); | |
private static readonly object syncObject = new object(); | |
public static WcfHelper Wcf |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
List<string> dict = new List<string> | |
{ | |
"Кодилак".ToUpper(), | |
"Кодла".ToUpper(), | |
"Колода".ToUpper(), | |
"Изуируд".ToUpper(), |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
string val1 = "Savin Arseni".ToUpper(); | |
string val2 = "Arseniy Savin".ToUpper(); | |
int res = GetLevensteinDistance(val1, val2); |
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 T Deserialize<T>(string xmlPath) | |
{ | |
try | |
{ | |
using (FileStream fileReader = new FileStream(xmlPath, FileMode.Open, FileAccess.Read)) | |
{ | |
T result = (T)new XmlSerializer(typeof(T)).Deserialize(fileReader); | |
fileReader.Close(); |
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
// Adding dll config for reference assembly into build folder. add this list into csproj file your library assembly. | |
<ItemGroup> | |
<Content Include="app.config"> | |
<Link>$(TargetName).dll.config</Link> | |
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory> | |
</Content> | |
</ItemGroup> |
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
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
using (var log = new LogScope()) | |
{ | |
try | |
{ | |
var tM = new TestModel | |
{ |
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
/// <summary> | |
/// Format placeholder in string | |
/// </summary> | |
public static class StringExtension | |
{ | |
public static string FormatPlaceholder(this string inString, params string[] param) | |
{ | |
int placeholderCounter = 0; | |
string[] placeholder = new string[param.Length]; |
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
#region MEF dll example | |
namespace MEF | |
{ | |
public interface ICore | |
{ | |
String PerformOperations(string data, string command); | |
string Operation(string data, IOperation oper); | |
} |
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
SELECT cast(TextData AS XML) | |
,DatabaseName | |
,TransactionID | |
,HostName | |
,ApplicationName | |
,LoginName | |
,SPID | |
,Duration | |
,StartTime | |
,EndTime |
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
SELECT | |
j.name AS job_name | |
,ja.start_execution_date | |
,ISNULL(last_executed_step_id, 0) + 1 AS current_executed_step_id | |
,js.step_name | |
,ja.session_id | |
,js.command | |
,js.last_run_duration | |
,ja.job_id | |
FROM msdb.dbo.sysjobactivity ja |