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 Website | |
{ | |
public class MvcApplication : System.Web.HttpApplication | |
{ | |
public static void RegisterRoutes(RouteCollection routes) | |
{ | |
routes.IgnoreRoute("{resource}.axd/{*pathInfo}"); | |
routes.MapRoute( | |
"Statics", |
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 ConsoleApplication2 | |
{ | |
using System; | |
using System.Threading; | |
using System.Threading.Tasks; | |
using Autofac; | |
using Fooidity; | |
using Topshelf; |
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.Timers; | |
using Topshelf; | |
namespace ConsoleApplication | |
{ | |
public interface IProcess | |
{ | |
void ProcessHandler(object o, ElapsedEventArgs args); |
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
First, install grunt-cli in local project | |
> npm install grunt-cli | |
Then put following command in pre build event | |
cd $(SolutionDir)webapp\node_modules\.bin | |
grunt.cmd build | |
Note that "webapp" directory is just for my project, maske sure to put correct path for your case. |
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 LocalDBSample | |
{ | |
using System; | |
using System.Data.SqlClient; | |
using System.IO; | |
using System.Reflection; | |
public class LocalDBHelper | |
{ | |
public static string DataDirectory |
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> | |
/// Converting the string value to T type | |
/// </summary> | |
/// <typeparam name="T">Type to convert string value to</typeparam> | |
/// <param name="value">String value to be converted to type T</param> | |
/// <returns>Returns converted string value to type T</returns> | |
public static T ConvertTo<T>(this string value) where T : IConvertible | |
{ | |
var typeCode = default(T).GetTypeCode(); | |
switch (typeCode) |
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
Related Properties | |
- HttpRuntime.AppDomainAppVirtualPath | |
- Request.ApplicationPath | |
Methods for getting physical file path: | |
- System.Web.HttpContext.Current.Server.MapPath() | |
Methods for generating content URL: |
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 MongoDB.Bson; | |
using MongoDB.Driver; | |
using MongoDB.Driver.Builders; | |
namespace Recipes.ReadModel | |
{ | |
public class MongoDbProjectionWriter<T> : IProjectionWriter<T> | |
where T: class | |
{ |
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; | |
using System.Collections.Generic; | |
using System.ComponentModel.DataAnnotations; | |
using System.Data.Entity; | |
using System.Data.Entity.Infrastructure; | |
using System.Data.Entity.SqlServer; | |
using System.Linq; | |
using System.Linq.Expressions; | |
using System.Reflection; |
NewerOlder