Пример #1
0
        public void CreateIdentifierFromString()
        {
            var guidValue = Guid.NewGuid().ToString();

            var id = new Identifier(guidValue);
            Assert.IsNotNull(id);
            Assert.IsNotNullOrEmpty(id.ToString());

            // make sure the string value of the identifier is the same as the guid's string value
            Assert.AreEqual(id.ToString(), guidValue);
            Debug.WriteLine("{0} == {1}", id.ToString(), guidValue);
        }
 public IContact Get(Identifier id)
 {
     return contacts.SingleOrDefault(g => g.Id == id);
 }
 public bool Delete(Identifier id)
 {
     var contact = contacts.SingleOrDefault(g => g.Id == id);
     contacts.Remove(contact);
     return true;
 }
Пример #4
0
 public void CreateNewIdentifier()
 {
     var id = new Identifier();
     Assert.IsNotNull(id);
     Assert.IsNotNullOrEmpty(id.ToString());
 }
Пример #5
0
 public T GetContact <T>(Contracts.Domain.Identifier contactIdentifier) where T : IIdentifiable
 {
     return(Mapper.Map <T>(repositoryContext.Contacts.Get(contactIdentifier)));
 }
Пример #6
0
 public Contracts.Domain.IContact GetContact(Contracts.Domain.Identifier contactIdentifier)
 {
     return(repositoryContext.Contacts.Get(contactIdentifier));
 }