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 Web.AppStart; | |
| using WebActivator; | |
| [assembly: PostApplicationStartMethod(typeof(Bundles), "Start")] | |
| namespace Web.AppStart | |
| { | |
| using System.Collections.Generic; | |
| using System.Web; |
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
| namespace Web | |
| { | |
| using System; | |
| using System.Web; | |
| using System.Web.Http; | |
| using System.Web.Mvc; | |
| using System.Web.Optimization; | |
| using System.Web.Routing; | |
| using NLog; |
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.Web; | |
| using Web.AppStart; | |
| [assembly: WebActivator.PreApplicationStartMethod(typeof(DependencyInjection), "BootstrapContainer")] | |
| namespace Web.AppStart | |
| { | |
| using System; | |
| using System.IO; |
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
| namespace Core.Tests | |
| { | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Reflection; | |
| using Moq; | |
| public static class MoqVerifier |
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
| namespace Web.Extensions.Control | |
| { | |
| public static partial class HtmlHelperExtensions | |
| { | |
| // Usage: @Html.ListBoxWithAttributesFor(m => m.Foo, Model.Foos, false) | |
| // See SelectListItemWithAttributes | |
| public static MvcHtmlString ListBoxWithAttributesFor<TModel, TProperty>(this HtmlHelper<TModel> htmlHelper, Expression<Func<TModel, TProperty>> expression, IEnumerable<SelectListItemWithAttributes> selectList, bool multiple = true) | |
| { | |
| if (expression == null) | |
| { |
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
| namespace Web.Extensions.Control | |
| { | |
| using System.Collections.Generic; | |
| using System.Web.Mvc; | |
| // Usage: foos.Select(x => new SelectListItemWithAttributes | |
| // { | |
| // Attributes = new Dictionary<string, object>() { { "foootherid", x.SomeOtherId } }, | |
| // Text = x.Name, |
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
| EXEC sp_MSForEachTable 'ALTER TABLE ? NOCHECK CONSTRAINT ALL' | |
| GO | |
| EXEC sp_MSForEachTable 'TRUNCATE TABLE ?' | |
| GO | |
| EXEC sp_MSForEachTable 'ALTER TABLE ? CHECK CONSTRAINT ALL' | |
| GO |
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
| /****** Object: UserDefinedTableType [dbo].[IndexedDictionary] ******/ | |
| IF EXISTS (SELECT * FROM sys.types st JOIN sys.schemas ss ON st.schema_id = ss.schema_id WHERE st.name = N'IndexedDictionary' AND ss.name = N'dbo') | |
| DROP TYPE [dbo].[IndexedDictionary] | |
| GO | |
| /****** Object: UserDefinedTableType [dbo].[IndexedDictionary] ******/ | |
| CREATE TYPE [dbo].[IndexedDictionary] AS TABLE( | |
| [Index] [int] NULL, | |
| [Key] [nvarchar](255) NULL, | |
| [Value] [nvarchar](255) NULL |
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 (Microsoft.VisualBasic.FileIO.TextFieldParser parser = new Microsoft.VisualBasic.FileIO.TextFieldParser("C:\\testfile.txt")) { | |
| parser.TextFieldType = Microsoft.VisualBasic.FileIO.FieldType.Delimited; | |
| parser.SetDelimiters(","); | |
| string[] currentRow = null; | |
| while (!parser.EndOfData) { | |
| try { | |
| currentRow = parser.ReadFields(); | |
| string currentField = null; | |
| foreach (string field in currentRow) { | |
| currentField = field; |
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
| -- SQL 2008 | |
| DECLARE @CurrentDate DATETIME = (cast(GETDATE() as date)) | |
| -- Pre SQL 2008 | |
| DECLARE @CurrentDate DATETIME = DateAdd(Day, Datediff(Day, 0, GetDate()), 0) |