Skip to content

Instantly share code, notes, and snippets.

@thojaw
thojaw / TestMVC.cs
Created December 7, 2017 06:51
MVC Reflection based checking of attributes
// Put this in a unit test
var query = Assembly.Load("MyMVCProjectAssemblyName")
.GetTypes()
.Where(x => x.Name.EndsWith("Controller"))
.Where(x => !x.IsAbstract)
.Select(x => new
{
Name = x.Name.Substring(0, x.Name.Length - 10),
Type = x,
@thojaw
thojaw / Lotto.cs
Created August 1, 2012 22:27
Lösung des Lotto-Rätsels mit nur einem LINQ Query
using System;
using System.Diagnostics;
using System.Linq;
namespace ThomasJaworski.Experiments
{
// Lösung des Lotto-Rätsels (siehe z.B. http://www.onlinewahn.de/mega-r.htm) mit nur einem LINQ-Query,
// bewußt nicht auf Performance ausgelegt sondern auf leicht lesbaren Code
class LottoRechner
{
using System;
using System.Collections.Specialized;
using System.ComponentModel;
namespace ThomasJaworski.ComponentModel
{
public abstract class ChangeListener : INotifyPropertyChanged, IDisposable
{
#region *** Members ***
protected string _propertyName;