public UnitOfWok(string connectionString) { this._context = new ContactListContext(connectionString); this.People = new PersonRepository(this._context); this.Phones = new PhoneRepository(this._context); this.Emails = new EmailRepository(this._context); }
public void Initialize() { var options = new DbContextOptionsBuilder <ContactListContext>() .UseInMemoryDatabase(databaseName: "inMemoryDb") .Options; _dbContext = new ContactListContext(options); _personRepository = new PersonRepository(_dbContext); _peopleService = new PeopleService(_personRepository); }
void IActionFilter.OnActionExecuted(ActionExecutedContext filterContext) { //if (System.Web.HttpContext.Current.Application["TraceLogState"] == null || // System.Web.HttpContext.Current.Application["TraceLogState"].ToString() != "ON") return; if (TRACE_LEVEL_EXIT < 1) { return; } var sb = new StringBuilder(); sb.Append("Exit: "); DiscoverObjectProperties(sb, filterContext.Result, TRACE_LEVEL_EXIT); var message = sb.ToString(); ContactListContext.LogTrace(message); }
void IActionFilter.OnActionExecuting(ActionExecutingContext filterContext) { //if (System.Web.HttpContext.Current.Application["TraceLogState"] == null || // System.Web.HttpContext.Current.Application["TraceLogState"].ToString() != "ON") return; if (TRACE_LEVEL_ENTRY < 1) { return; } var sb = new StringBuilder(); sb.Append("Enter: "); sb.Append("ActionName:").Append(filterContext.ActionDescriptor.ActionName).Append("; "); sb.Append("ControllerName:") .Append(filterContext.ActionDescriptor.ControllerDescriptor.ControllerName) .Append("; "); sb.Append("ActionParameters:{"); var keys = filterContext.ActionParameters.Keys.ToArray(); for (int i = 0; i < keys.Count(); i++) { sb.Append(keys[i]).Append(":"); var value = filterContext.ActionParameters[keys[i]]; if (keys[i].ToUpper().Contains(PASSWORD_STRING)) { sb.Append("xxxxxxxx"); } else { ParseParameterProperties(sb, value, TRACE_LEVEL_ENTRY); } if (i + 1 < keys.Count()) { sb.Append("; "); } } sb.Append("} "); var message = sb.ToString(); ContactListContext.LogTrace(message); }
public void OnException(ExceptionContext filterContext) { if (!filterContext.ExceptionHandled) { var msg = new string[2]; msg[0] = filterContext.Exception.Message; ContactListContext.LogException(filterContext.Exception); HttpContext.Current.Session["CustomErrorMessage"] = msg[0]; filterContext.Result = new ViewResult { ViewName = "Exception", ViewData = new ViewDataDictionary <string>(msg[0]) }; filterContext.ExceptionHandled = true; } }
public ContactsController() { _db = new ContactListContext(); }
public AddressesController(ContactListContext context, IAddressRepository addressRepository) { _context = context; _addressRepository = addressRepository; }
public PhoneNumberRepository(ContactListContext context) { _context = context; }
public CategoriasController(ContactListContext context) { _context = context; }
public ContactRepository(ContactListContext context) : base(context) { }
public PhoneRepository(ContactListContext context) { this._context = context; }
public EmailRepository(ContactListContext context) { this._context = context; }
public AddressRepository(ContactListContext context) { _context = context; }
public TagRepository(ContactListContext dbContext) : base(dbContext) { }
public PersonRepository(ContactListContext context) { this._context = context; }
public ContactRepository(ContactListContext dbContext) { _dbContext = dbContext; }
public PhoneRepository(ContactListContext dbContext) : base(dbContext) { }
public ValuesController(ContactListContext contactListContext) { _contactListContext = contactListContext; }
public PersonRepository(ContactListContext context) : base(context) { }
public Contacts(ContactListContext context, ILogger <Contacts> logger) { _contactList = context; _logger = logger; }
public EmailRepository(ContactListContext dbContext) : base(dbContext) { }
public ContactRepository(ContactListContext context) { _context = context; }
public CategoriaService(ContactListContext context) { _context = context; }
public ContactListItemsController(ContactListContext context) { _context = context; }
public TestController(ContactListContext context) { _context = context; }
public ContactsController(ContactListContext context, IContactRepository contactRepository) { _context = context; _contactRepository = contactRepository; }
public PersonRepository(ContactListContext dbContext) { _dbContext = dbContext; }
public PhoneNumbersController(ContactListContext context, IPhoneNumberRepository phoneNumberRepository) { _context = context; _phoneNumberRepository = phoneNumberRepository; }