Skip to content

Instantly share code, notes, and snippets.

View dhont's full-sized avatar

Dragos Hont dhont

  • bucharest, romania
View GitHub Profile
using System;
using AutoMapper;
using Microsoft.VisualStudio.TestTools.UnitTesting;
namespace AutoMapperSpecificTests
{
public class FirstClass
{
public Guid? SomeGuidProperty { get; set; }
public Guid? SomeAloneProperty { get; set; }
@dhont
dhont / gist:8298537
Last active November 26, 2019 23:39
A basic implementation of a thread safe List. Is particularly useful when combined with GetEnumerator() and provides an Remove(T) implementation.
using System;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
namespace Tinmar.Domain.Common
{
public sealed class ConcurrentList<T> : IList<T>
{
private readonly IList<T> _items = new List<T>();
private static void RegisterKendoUiStyles(BundleCollection bundles)
{
bundles.Add(new StyleBundle("~/kendouistyles")
.Include("~/Content/kendo.compatibility.css",new AbsolutePathCssRewriteUrlTransform())
.Include("~/Content/kendo/2013.3.1324/kendo.common.min.css", new AbsolutePathCssRewriteUrlTransform())
.Include("~/Content/kendo/2013.3.1324/kendo.dataviz.min.css", new AbsolutePathCssRewriteUrlTransform())
.Include("~/Content/kendo/2013.3.1324/kendo.metro.min.css", new AbsolutePathCssRewriteUrlTransform())
.Include("~/Content/kendo/2013.3.1324/kendo.dataviz.metro.min.css", new AbsolutePathCssRewriteUrlTransform()));
}
using System;
using System.Text.RegularExpressions;
using System.Web;
using System.Web.Optimization;
namespace Web.Extensions
{
/// <summary>
/// ref: http://aspnetoptimization.codeplex.com/workitem/83
/// </summary>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Transactions;
using Domain.Contracts;
using ElmahExtensions;
using Microsoft.Practices.ServiceLocation;
namespace Domain.Common
{
public static class EfBuilderExtensions
{
/// <summary>
/// super simple and dump translation of .Contains because is not supported pe EF plus
/// this translates to contains in EF SQL
/// </summary>
/// <param name="source"></param>
/// <param name="contains"></param>
/// <returns></returns>
public static IQueryable<Raspuns> WhereRaspunsContains(this IQueryable<Raspuns> source, IList<int> contains)