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 partial class AddCategory : DbMigration | |
{ | |
public override void Up() | |
{ | |
CreateTable( | |
"dbo.Categories", | |
c => new | |
{ | |
Id = c.Int(nullable: false, identity: true), | |
Name = c.String(), |
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 interface IVerb | |
{ | |
void Run(); | |
} |
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 CategoriesController : Controller | |
{ | |
private Lazy<ICategoryRepository> _categoryRepository; | |
protected ICategoryRepository CategoryRepository | |
{ | |
get { return _categoryRepository.Value; } | |
} | |
private Lazy<IMapper> _mapper; |
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 CacheInterceptor : IInterceptor | |
{ | |
private ICacheService _cacheService; | |
public CacheInterceptor(ICacheService cacheService) | |
{ | |
_cacheService = cacheService; | |
} | |
public void Intercept(IInvocation invocation) |
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
class Program | |
{ | |
private static NLog.Logger _logger = NLog.LogManager.GetCurrentClassLogger(); | |
static void Main(string[] args) | |
{ | |
_logger.Info("Start"); | |
try | |
{ | |
var content = Download("http://plawgo.pl"); |
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 CacheService : ICacheService | |
{ | |
private ICacheManager<object> _cache; | |
private const string _defaultCacheName = "defaultCache"; | |
public CacheService() | |
{ | |
var builder = ConfigurationBuilder.LoadConfiguration(_defaultCacheName).Builder; | |
builder.WithMicrosoftLogging(s => s.AddNLog()); |
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 DateService : IDateService | |
{ | |
public DateTime ConvertToUtc(DateTime dateTime) | |
{ | |
TimeZoneInfo timeZone = TimeZoneInfo.FindSystemTimeZoneById(GetTimezone()); | |
var date = DateTime.SpecifyKind(dateTime, DateTimeKind.Unspecified); | |
return TimeZoneInfo.ConvertTimeToUtc(date, timeZone); | |
} | |
public DateTime ConvertToLocal(DateTime dateTime) |
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 Products1Controller : Controller | |
{ | |
private DataContext db = new DataContext(); | |
// GET: /Products1/ | |
public ActionResult Index() | |
{ | |
return View(db.Products.ToList()); | |
} |
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 BaseModel | |
{ | |
public BaseModel() | |
{ | |
IsActive = true; | |
} | |
public int Id { get; set; } | |
public bool IsActive { get; 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
public class Benchmarks | |
{ | |
[Benchmark] | |
public void UsingResources() | |
{ | |
var test = Resources.One; | |
} | |
} |