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
//Generic Repository Pattern for Entity Framework | |
//http://www.tugberkugurlu.com/archive/generic-repository-pattern-entity-framework-asp-net-mvc-and-unit-testing-triangle | |
public abstract class GenericRepository<C, T> : | |
IDisposable, IGenericRepository<T> where T : class where C : DbContext, new() { | |
private C _entities = new C(); | |
public C Context { | |
get { return _entities; } | |
set { _entities = value; } |
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
EXEC sp_MSforeachtable @command1 = "DROP TABLE ?" | |
--Or maybe just delete | |
EXEC sp_MSForEachTable "DELETE FROM ?" | |
--or truncate | |
EXEC sp_MSForEachTable "TRUNCATE TABLE ?" |
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
//Must execute in the Package Manager Console | |
Update-Database -Script -SourceMigration: 0 |
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
net use X: \\<servername>\F$ /Persistent:No /user:<domain>\<username> <password> |
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
//Update the Configure method of the AppHost to resemble the following. | |
public sealed class AppHost : AppHostBase | |
{ | |
public AppHost() | |
: base("ServiceStack", typeof(ExampleService).Assembly) | |
{ | |
} | |
public override void Configure(Container container) | |
{ |
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 Microsoft.Practices.Unity; | |
using System.Web.Http; | |
using System.Web.Mvc; | |
namespace WebApplication1 | |
{ | |
public static class UnityConfig | |
{ | |
public static void RegisterComponents() | |
{ |
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
var distinctMessages = messages.GroupBy(x => x.Text).Select(group => group.First()).ToList(); |
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
// | |
// main.swift | |
// ConsoleApp1 | |
// | |
import Foundation | |
let date = NSDate(); | |
let dateFormatter = NSDateFormatter() | |
dateFormatter.timeStyle = NSDateFormatterStyle.MediumStyle //Set time style |
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
// | |
// main.swift | |
// ConsoleApp1 | |
import Foundation | |
var cityList = Array<String>() | |
cityList.append("Vienna") | |
cityList.append("Munich") | |
cityList.append("Berlin") |
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 EntityFramework.Auditing; | |
using SESPolicy.Api.Web.Components; | |
using SESPolicy.Common; | |
using SESPolicy.Model; | |
using System; | |
using System.Collections.Generic; | |
using System.Data.Entity; | |
using System.Linq; | |
using System.Net; | |
using System.Net.Http; |
OlderNewer