Skip to content

Commit

Permalink
New is a four letter word
Browse files Browse the repository at this point in the history
  • Loading branch information
leosperry committed Nov 27, 2020
1 parent 4392896 commit ef2fdf1
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Samples/Misc.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Samples
{
class Misc
{
}
}
20 changes: 20 additions & 0 deletions Samples/NewIs4LetterWord/BasicContainer.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
using System;
using System.Collections.Generic;
using System.Text;

namespace Samples.NewIs4LetterWord
{
public class BasicContainer
{
Dictionary<Type, Func<object>> _resolvers = new Dictionary<Type, Func<object>>();
public void Register<T>(Func<T> resolver)
{
_resolvers[typeof(T)] = () => resolver();
}

public T Resolve<T>()
{
return (T)_resolvers[typeof(T)]();
}
}
}

0 comments on commit ef2fdf1

Please sign in to comment.