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
context.Departments.Add(new Department() { Id = 1, Name = "Department 1" }); | |
context.Departments.Add(new Department() { Id = 2, Name = "Department 2" }); | |
context.Employees.Add(new Employee() { Id = 1, ForeName = "John" }); | |
context.Employees.Add(new Employee() { Id = 2, ForeName = "Mark" }); | |
context.Employees.Add(new Employee() { Id = 3, ForeName = "Mat" }); |
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 TestDbSet<TEntity> : DbSet<TEntity>, IQueryable, IEnumerable<TEntity>, IDbAsyncEnumerable<TEntity> | |
where TEntity : class | |
{ | |
ObservableCollection<TEntity> _data; | |
IQueryable _query; | |
public TestDbSet() | |
{ | |
_data = new ObservableCollection<TEntity>(); | |
_query = _data.AsQueryable(); |
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
<configSections> | |
<section name="log4net" type="log4net.Config.Log4NetConfigurationSectionHandler, log4net" /> | |
</configSections> | |
<!-- more config --> | |
<log4net configSource="log4net.config" /> | |
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
<?xml version="1.0" encoding="utf-8"?> | |
<log4net> | |
<!-- Log to vs output window --> | |
<appender name="TraceAppender" type="log4net.Appender.TraceAppender" > | |
<layout type="log4net.Layout.PatternLayout"> | |
<conversionPattern value="%timestamp [%level] %-60message %newline" /> | |
</layout> | |
</appender> |
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 MvcApplication : System.Web.HttpApplication | |
{ | |
protected void Application_Start() | |
{ | |
// Configure log4net | |
log4net.Config.XmlConfigurator.Configure(); | |
} | |
} |
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
private static readonly ILog _logger = LogManager.GetLogger(System.Reflection.MethodBase.GetCurrentMethod().DeclaringType); | |
public ActionResult Index() | |
{ | |
_logger.Info("Displaying the home page"); | |
return View(); | |
} |
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
$server = "localhost"; | |
$instance = "Default"; | |
$database = "timesheets"; | |
$path = "sqlserver:\sql\$server\$instance\databases\$database\tables"; |
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
set-executionpolicy remotesigned | |
add-pssnapin sqlserverprovidersnapin100 | |
add-pssnapin sqlservercmdletsnapin100 |
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
$tableset = get-childitem $path -ErrorAction stop |
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
foreach ($table in $tableset) | |
{ | |
write-host $table.name | |
} |