This file contains 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 bool UrlExists(string url) | |
{ | |
try | |
{ | |
var request = WebRequest.Create(url) as HttpWebRequest; | |
if (request == null) return false; | |
request.Method = "HEAD"; | |
using (var response = (HttpWebResponse)request.GetResponse()) | |
{ | |
return response.StatusCode == HttpStatusCode.OK; |
This file contains 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
<Target Name="MvcBuildViews" AfterTargets="AfterBuild" Condition="'$(MvcBuildViews)'=='true'"> | |
<AspNetCompiler VirtualPath="temp" PhysicalPath="$(ProjectDir)\..\$(ProjectName)" /> | |
</Target> |
This file contains 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 DbContextExtensions | |
{ | |
public static void EntryAsModified<T>(this DbContext context, T entity) where T : class | |
{ | |
context.Entry(entity).State = EntityState.Modified; | |
} | |
public static void EntriesAsModified<T>(this DbContext context, IEnumerable<T> entities) where T : class | |
{ | |
foreach(var entity in entities) |
This file contains 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.Collections.ObjectModel; | |
using System.Collections.Generic; | |
namespace MyTest | |
{ | |
public class Person | |
{ | |
public Person() | |
{ | |
Tags = new Collection<Tag>(); |
This file contains 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
# Compiled source # | |
################### | |
*.com | |
*.class | |
*.dll | |
*.exe | |
*.o | |
*.so | |
# Packages # |
This file contains 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.Data.Entity; | |
namespace ConsoleApplication3 | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ |
This file contains 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.Net.Http; | |
using System.Web.Http.Controllers; | |
using System.Web.Http.Dispatcher; | |
using Ninject; | |
namespace WebApiNinjectIHttpControllerActivator | |
{ | |
public class NinjectKernelActivator: IHttpControllerActivator | |
{ |
This file contains 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
{ | |
"parameters":{ | |
"tbdb":"nasapoc", | |
"service":"prefix", | |
"template":"service.json", | |
"term_prefix":"11" | |
}, | |
"termHints":[ | |
{ | |
"name":"Soyuz T11", |
This file contains 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 Rootobject | |
{ | |
public Parameters parameters { get; set; } | |
public Termhint[] termHints { get; set; } | |
public int total { get; set; } | |
} | |
public class Parameters | |
{ | |
public string tbdb { get; set; } |
OlderNewer