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 CustomDBContext : DbContext | |
{ | |
public CustomDBContext() | |
{ | |
this.Configuration.LazyLoadingEnabled = false; | |
} | |
} |
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
namespace ExperimentWebApiNinject.Utilities.Interface | |
{ | |
public interface ILog | |
{ | |
void Write(string message); | |
} | |
public class Log : ILog | |
{ | |
public void Write(string message) |
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
namespace ExperimentMoq | |
{ | |
public class DbEntity | |
{ | |
public int Id { get; set; } | |
public string Name { get; set; } | |
} | |
public class CustomDbContext : DbContext, IDisposable | |
{ |
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 appXmlType = config.Formatters.XmlFormatter.SupportedMediaTypes.FirstOrDefault(t => t.MediaType == "application/xml"); | |
config.Formatters.XmlFormatter.SupportedMediaTypes.Remove(appXmlType); |
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
namespace ExperimentNinjectEF.Data.Interface | |
{ | |
public interface IDbContext : IDisposable | |
{ | |
DbSet<TEntity> Set<TEntity>() where TEntity : class; | |
int SaveChanges(); | |
} | |
} |
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
namespace ExperimentNinjectComposition | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
IKernel kernel = new StandardKernel( | |
new ExperimentNinjectComposition.Core.Module(), | |
new ExperimentNinjectComposition.ModuleA.Module(), | |
new ExperimentNinjectComposition.ModuleB.Module()); |