示例#1
0
 public void CreateAuthor(AuthorBusinessModel author)
 {
     var mapper = new AuthorMapper();
     var authorNew = mapper.Map(author);
     this.uow.Authors.Add(authorNew);
     this.uow.Commit();
     author.Id = authorNew.Id;// updates the author.Id to Id value from DB
 }
        public AuthorMapperTests()
        {
            Fixture fixture = new Fixture { RepeatCount = 1 };
            fixture.Behaviors.Remove(new ThrowingRecursionBehavior());
            fixture.Behaviors.Add(new OmitOnRecursionBehavior());
            fixture.Customizations.Add(new TypeRelay(typeof(Item), typeof(Book)));
            fixture.Customizations.Add(new TypeRelay(typeof(ItemBusinessModel), typeof(BookBusinessModel)));

            this.author = fixture.Create<Author>();
            this.authorModel = fixture.Create<AuthorBusinessModel>();
            this.mapper = new AuthorMapper();
        }
示例#3
0
 public void UpdateAuthor(AuthorBusinessModel author)
 {
     var mapper = new AuthorMapper();
     this.uow.Authors.Update(mapper.Map(author));
     this.uow.Commit();
 }
示例#4
0
 public void RemoveAuthor(AuthorBusinessModel author)
 {
     this.authorFacade.RemoveAuthorById(author.Id);
 }
示例#5
0
 public void CreateAuthor(AuthorBusinessModel author)
 {
     this.authorFacade.CreateAuthor(author);
     
 }
示例#6
0
 public void UpdateAuthor(AuthorBusinessModel author)
 {
     this.authorFacade.UpdateAuthor(author);
 }