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> | |
/// A helper class which helps conversion between enum and code. | |
/// </summary> | |
public static class EnumExt | |
{ | |
/// <summary> | |
/// Get a description of Enum | |
/// </summary> | |
/// <param name="value">Enum value</param> | |
/// <returns>description</returns> |
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
Alter table XXX add [CreateID] [int] NOT NULL | |
Alter table XXX add [CreateTS] [datetime] NOT NULL constraint DefaultModifyID default getdate() | |
Alter table XXX add [ModifyID] [int] NULL | |
Alter table XXX add [ModifyTS] [datetime] NULL | |
Alter table XXX add [InactiveID] [int] NULL | |
Alter table XXX add [InactiveTS] [datetime] NULL | |
Alter table XXX add [StatusID] [int] NOT NULL constraint DefaultStatusID default 1 |
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
1. Web Management Service => Started? | |
2. IIS Management Service => Enable Remote Connections | |
3. Web Deploy Installer => Ensure all options are installed | |
4. Fire wall => Ensure TCP Port 8172 is open | |
5. EC2 => Ensure TCP Port 8172 is open |
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
protected HttpResponseMessage Wrap<T>(Func<T> func) | |
{ | |
try | |
{ | |
var req = HttpContext.Current.Request; | |
Log.InfoFormat("Service: {0}", req.Path); | |
if (Log.IsDebugEnabled) | |
{ | |
req.InputStream.Position = 0; |
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 class FileDownloadHttpResponseMessage : HttpResponseMessage | |
{ | |
public FileDownloadHttpResponseMessage(string fileName, string content) | |
: base(HttpStatusCode.OK) | |
{ | |
Content = new StringContent(content); | |
// A text file is actually an octet-stream (pdf, etc) | |
Content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream"); |
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
.photo-fullscreen { | |
position: fixed; | |
z-index: 99; | |
color: white; | |
height: 100%; | |
width: 100%; | |
li { | |
text-align: center; | |
} |
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 class ListItemSection : DivSection | |
{ | |
public ListItemSection(HtmlHelper self, string className = null) | |
: base(self, className, "li") | |
{ | |
} | |
} |
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 class SelectListExt | |
{ | |
public static SelectList ToSelectList<TEnum>(this TEnum enumObj) | |
where TEnum : struct, IComparable, IFormattable, IConvertible | |
{ | |
var values = from TEnum e in Enum.GetValues(typeof(TEnum)) | |
select new { Id = e, Name = e.ToString() }; | |
return new SelectList(values, "Id", "Name", enumObj); | |
} | |
} |
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 class QueryableExt | |
{ | |
public static IOrderedQueryable<T> OrderBy<T>(IQueryable<T> source, string propertyName, bool descending, bool anotherLevel = false) | |
{ | |
ParameterExpression param = Expression.Parameter(typeof(T), string.Empty); // I don't care about some naming | |
MemberExpression property = Expression.PropertyOrField(param, propertyName); | |
LambdaExpression sort = Expression.Lambda(property, param); | |
MethodCallExpression call = Expression.Call( | |
typeof(Queryable), |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace Utilities | |
{ | |
public class CsvBuilder | |
{ | |
private readonly string delimiter; |