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 abstract class BaseNotifierJobExecuter<TJob> | |
| : INotifierJobExecuter | |
| where TJob : IJob | |
| { | |
| private ISchedulerFactory schedulerFactory = new StdSchedulerFactory(); | |
| public IScheduler scheduler = null; | |
| protected IJob jobAction = null; | |
| protected string CronExpression = String.Empty; | |
| protected string jobKey = String.Empty; |
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
| // nuget package http://www.nuget.org/packages/Quartz/ | |
| // http://www.quartz-scheduler.net/ | |
| public class SampleJob | |
| : IJob | |
| { | |
| public void Execute(IJobExecutionContext context) | |
| { | |
| Console.WriteLine("OK"); | |
| } |
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
| // obtain the structure map IContainer | |
| var validatorFactory = new ValidatorFactory(container); | |
| ModelValidatorProviders.Providers.Add(new FluentValidationModelValidatorProvider(validatorFactory)); | |
| public class ValidatorFactory : ValidatorFactoryBase | |
| { |
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 Autofac; | |
| using FluentValidation; | |
| using System; | |
| using System.Collections.Generic; | |
| using System.Linq; | |
| using System.Web; | |
| using System.Web.Mvc; | |
| namespace WebSite | |
| { |
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 MongoRepository<TEntity> | |
| where TEntity : class | |
| { | |
| private static readonly Lazy<string> _collectionName; | |
| private static int _mappingInitialized = 0; | |
| private static int _indexingInitialized = 0; | |
| private readonly Lazy<MongoCollection<TEntity>> _collection; | |
| private readonly MongoUrl _mongoUrl; |
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 MongoDB.Bson; | |
| using MongoDB.Bson.Serialization.Attributes; | |
| using MongoDB.Bson.Serialization.IdGenerators; | |
| using MongoDB.Driver; | |
| using MongoDB.Driver.Builders; | |
| using MongoDB.Driver.Linq; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Linq; | |
| using System; | |
| using System.Collections.Generic; |
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.Linq; | |
| using System.Linq.Expressions; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using MongoDB.Bson; | |
| using MongoDB.Driver; | |
| using MongoDB.Driver.Builders; |
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
| int ParseTime(string input) | |
| { | |
| var totalMinutes = 0; | |
| input = Regex.Replace(input.ToLower(), "[^\\d|m|h]", string.Empty); | |
| var hoursMatch = Regex.Match(input, "(?<Hours>\\d+)h"); | |
| if (hoursMatch.Success) | |
| { |
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
| // Domain | |
| interface IUsersRepository | |
| { | |
| IEnumerable<User> FindAll(int pageIndex, int pageSize); | |
| } | |
| class User | |
| { | |
| public int Id { get; private set; } |
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.Configuration; | |
| using System.Linq; | |
| using System.Web; | |
| using MongoDB.Bson; | |
| using MongoDB.Driver; | |
| using MongoDB.Driver.Builders; | |
| using SteamLibraryIntersecter.Models; | |
| using SteamLibraryIntersecter.Steam.Entities; |