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
| //scriptcs -install scriptcs.webapi | |
| var webApi = Require<WebApi>(); | |
| var server = webApi.CreateServer("http://localhost:8080"); | |
| server.OpenAsync().Wait(); | |
| Console.ReadKey(); |
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 IEnumerable<string> GetAssemblyNames(List<string> packageids, string version) | |
| { | |
| var packageDir = _fileSystem.CurrentDirectory + @"\" + "packages"; | |
| if (!Directory.Exists(packageDir)) | |
| return Enumerable.Empty<string>(); | |
| var items = new List<string>(); | |
| var repository = new LocalPackageRepository(packageDir); |
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 static MethodInfo GetMethodInfo<T, U>(Expression<Func<T, U>> expression) | |
| { | |
| var method = expression.Body as MethodCallExpression; | |
| if (method != null) | |
| return method.Method; | |
| throw new ArgumentException("Expression is wrong"); | |
| } | |
| public static MethodInfo GetMethodInfo<T, U>(Expression<Action<T>> expression) |
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.Linq.Expressions; | |
| using System.Reflection; | |
| using WebApi.Delta; | |
| namespace Hst.Deals.API.Infrastructure | |
| { | |
| internal class CompiledPropertyAccessor<TEntityType> : PropertyAccessor<TEntityType> where TEntityType : class | |
| { | |
| private Action<TEntityType, object> _setter; |
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 GenericRepository<TEntity> : IGenericRepository<TEntity> where TEntity : class, IId | |
| { | |
| internal DbContext Context; | |
| internal DbSet<TEntity> DbSet; | |
| public ICache Cache { get; set; } | |
| public GenericRepository(DbContext context) | |
| { | |
| Context = context; |
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
| #r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.SelfHost.dll" | |
| #r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Packages\Newtonsoft.Json.4.5.6\lib\net40\Newtonsoft.Json.dll" | |
| #r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Web.Http.dll" | |
| #r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.Formatting.dll" | |
| #r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.WebRequest.dll" | |
| #r "C:\Program Files (x86)\Microsoft ASP.NET\ASP.NET MVC 4\Assemblies\System.Net.Http.dll" | |
| #r "c:\Users\Filip\documents\visual studio 2012\Projects\Roslyn.WebApi\packages\Roslyn.Compilers.Common.1.2.20906.2\lib\net45\Roslyn.Compilers.dll" | |
| #r "c:\users\filip\documents\visual studio 2012\Projects\Roslyn.WebApi\packages\Roslyn.Compilers.CSharp.1.2.20906.2\lib\net45\Roslyn.Compilers.CSharp.dll" | |
| using System; |
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.Linq; | |
| using System.Web; | |
| using System.Net.Http.Formatting; | |
| using MsgPack.Serialization; | |
| using System.Threading.Tasks; | |
| using System.IO; | |
| using System.Net.Http.Headers; | |
| using System.Net; |
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.Net.Http.Headers; | |
| using System.Text; | |
| using System.Threading.Tasks; | |
| using System.Web.Http; | |
| using System.Xml; | |
| using Newtonsoft.Json; | |
| using Newtonsoft.Json.Serialization; | |
| using System.Net.Http.Formatting; | |
| using System.Net.Http; | |
| using System; |
NewerOlder