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
namespace CodeGenExperiement | |
{ | |
using System; | |
#line 1 "c:\users\music\documents\visual studio 2010\Projects\CodeGenExperiement\CodeGenExperiement\PreTextTemplate1.tt" | |
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.VisualStudio.TextTemplating", "10.0.0.0")] | |
public partial class PreTextTemplate1 : PreTextTemplate1Base | |
{ | |
public virtual string TransformText() |
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
void Main() | |
{ | |
var N = 5; | |
Node.Graph.Add(new Node()); | |
bool canExpand = true; | |
while (canExpand) | |
{ | |
Func<int, IEnumerable<Move>> addNodes = steps => from c in Node.Graph |
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
void Main() | |
{ | |
//Store the root node in Container | |
//While (there are nodes in Container) | |
// N = Get the "next" node from Container | |
// Store all the children of N in Container | |
// Do some work on N | |
var paths = new List<int[]>(); | |
int N = 10; | |
var stack = new Stack(); |
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
if (EomAppCommon.Settings.DebugEomDatabase) | |
{ | |
var form = new System.Windows.Forms.Form(); | |
var grid = new System.Windows.Forms.DataGridView { | |
AutoGenerateColumns = true, | |
Dock = System.Windows.Forms.DockStyle.Fill, | |
DataSource = | |
(from c in new [] { | |
Tuple.Create("DADatabaseR1ConnectionString", this.DADatabaseR1ConnectionString), | |
Tuple.Create("StatsYear", this.StatsYear.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
namespace MixinDemo | |
{ | |
public interface ILogger | |
{ | |
} | |
} |
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
static void CopyProperties(object sourceObject, object targetObject, bool deepCopy = true) | |
{ | |
if (sourceObject != null && targetObject != null) | |
{ | |
(from sourceProperty in sourceObject.GetType().GetProperties().AsEnumerable() | |
from targetProperty in targetObject.GetType().GetProperties().AsEnumerable() | |
where sourceProperty.Name.ToUpper() == targetProperty.Name.ToUpper() | |
let sourceValue = sourceProperty.GetValue(sourceObject, null) | |
where sourceValue != null | |
select CopyProperty(targetProperty, targetObject, sourceValue, deepCopy)) |
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.Data.SqlClient; | |
using System.Text.RegularExpressions; | |
using System.Collections; | |
public static class SqlUtility | |
{ | |
public static T ExecuteScalar<T>(string connStr, string query, params object[] queryParams) | |
{ | |
using (var con = new SqlConnection(connStr)) | |
using (var cmd = new SqlCommand(query, con)) |
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.Net.Mail; | |
public static class EmailUtility | |
{ | |
public static void SendEmail(string from, string[] to, string[] cc, string subject, string body, bool isHTML) | |
{ | |
MailMessage message = new MailMessage | |
{ | |
Subject = subject, |
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.Web.Http; | |
using DirectAgents.Domain.Concrete; | |
using EomToolWeb.Models; | |
namespace EomToolWeb.Controllers | |
{ | |
public class CampaignsApiController : ApiController | |
{ | |
private EFDbContext db = new EFDbContext(); |