Exemplo n.º 1
0
        public void CreateContact()
        {
            using (ILoggerFactory logFact = new LoggerFactory())
            {
                using (TAPIDataContext db = createNewDataContextInstance())
                {
                    db.Database.EnsureDeleted();
                    db.Database.EnsureCreated();

                    IContactService csrv = new ContactDBService(db, logFact);
                    Contact         ct   = csrv.ListByName(contactName, true).FirstOrDefault();

                    if (ct == null)
                    {
                        ct = new Contact(contactName);
                        csrv.Add(ct);
                    }
                }
            }
        }
Exemplo n.º 2
0
 public ContactDBService(TAPIDataContext dbContext, ILoggerFactory loggerFactory)
 {
     _dbContext = dbContext;
     _logger    = loggerFactory.CreateLogger <ContactDBService>();
 }